Spherical() public method

public Spherical ( float r, float theta, float phi ) : Point3
r float
theta float
phi float
return Point3
        public Point3[,] SphereCoordinates()
        {
            Point3[,] pts = new Point3[30, 20];
            var m = new Matrix3 ();
            var mt = Matrix3.Translate3 (xc, yc, zc);

            for (int i = 0; i < pts.GetLength(0); i++) {
                for (int j = 0; j < pts.GetLength(1); j++) {
                    pts[i, j] = m.Spherical(r, i * 180 / (pts.GetLength(0) - 1),
                        j * 360 / (pts.GetLength(1) - 1));
                    pts[i, j].Transform(mt);
                }
            }
            return pts;
        }
Example #2
0
        public Point3[,] SphereCoordinates()
        {
            Point3[,] pts = new Point3[30, 20];
            var m  = new Matrix3();
            var mt = Matrix3.Translate3(xc, yc, zc);

            for (int i = 0; i < pts.GetLength(0); i++)
            {
                for (int j = 0; j < pts.GetLength(1); j++)
                {
                    pts[i, j] = m.Spherical(r, i * 180 / (pts.GetLength(0) - 1),
                                            j * 360 / (pts.GetLength(1) - 1));
                    pts[i, j].Transform(mt);
                }
            }
            return(pts);
        }