R3.Geometry.Sphere.RotateSphere C# (CSharp) Method

RotateSphere() public static method

public static RotateSphere ( Sphere s, Vector3D axis, double rotation ) : void
s Sphere
axis Vector3D
rotation double
return void
        public static void RotateSphere( Sphere s, Vector3D axis, double rotation )
        {
            if( s.IsPlane )
            {
                Vector3D o = s.Offset;
                o.RotateAboutAxis( axis, rotation );
                s.Offset = o;
            }

            Vector3D c = s.Center;
            c.RotateAboutAxis( axis, rotation );
            s.Center = c;
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Helper to rotate a sphere about the z axis.
        /// </summary>
        internal static void RotateSphere(Sphere s, double rotation)
        {
            Vector3D zAxis = new Vector3D(0, 0, 1);

            Sphere.RotateSphere(s, zAxis, rotation);
        }