Subdivide() public method

Calculate n points around the circle
public Subdivide ( int n ) : Vector3D[]
n int
return Vector3D[]
Esempio n. 1
0
        public H3.Cell.Edge[] Hyperboloid()
        {
            // Draw to circles of fibers, then twist them.
            List<H3.Cell.Edge> fiberList = new List<H3.Cell.Edge>();

            Vector3D cen = new Vector3D( 0, 0, 0.5 );
            double rad = .3;
            Circle3D c1 = new Circle3D { Center = cen, Radius = rad };
            Circle3D c2 = new Circle3D { Center = -cen, Radius = rad };

            int n = 50;
            Vector3D[] points1 = c1.Subdivide( n );
            Vector3D[] points2 = c2.Subdivide( n );

            double twist = 2 * Math.PI / 3;
            for( int i = 0; i < points2.Length; i++ )
            {
                points2[i].RotateXY( twist );

                Vector3D e1, e2;
                H3Models.Ball.GeodesicIdealEndpoints( points1[i], points2[i], out e1, out e2 );

                e1 = Transform( e1 );
                e2 = Transform( e2 );

                fiberList.Add( new H3.Cell.Edge( e1, e2 ) );
            }

            return fiberList.ToArray();
        }