Ejemplo n.º 1
0
        public void BuildPoints()
        {
            double radiansPerStep = TWO_PI / PointsInCircle;
            Point point = new Point() { Index = Points.Count };
            point.SetRThetaPhi(Radius, 0, 0);
            Points.Add(point);

            for (double i = 1; i < PointsInCircle / 2; i++)
            {
                double theta = i * radiansPerStep;
                for (double j = 0; j < PointsInCircle / 2; j++)
                {
                    double phi = j * radiansPerStep;
                    point = new Point() { Index = Points.Count };
                    point.SetRThetaPhi(Radius, theta, phi);
                    Points.Add(point);
                }
            }
            for (double i = (PointsInCircle / 2) + 1; i < PointsInCircle; i++)
            {
                double theta = i * radiansPerStep;
                for (double j = 0; j < PointsInCircle / 2; j++)
                {
                    double phi = j * radiansPerStep;
                    point = new Point() { Index = Points.Count };
                    point.SetRThetaPhi(Radius, theta, phi);
                    Points.Add(point);
                }
            }

            point = new Point() { Index = Points.Count };
            point.SetRThetaPhi(Radius, Math.PI, 0);
            Points.Add(point);
        }