Exemplo n.º 1
0
        public override void Calculate(List <KangarooSolver.Particle> p)
        {
            int L = PIndex.Length;

            Point3d[] Pts = new Point3d[L];

            for (int i = 0; i < L; i++)
            {
                Pts[i] = p[PIndex[i]].Position;
            }

            Sphere S = Sphere.FitSphereToPoints(Pts);

            for (int i = 0; i < L; i++)
            {
                Move[i]      = S.ClosestPoint(Pts[i]) - Pts[i];
                Weighting[i] = Strength;
            }
        }