R3.Geometry.Circle3D.FromCenterAnd2Points C# (CSharp) 메소드

FromCenterAnd2Points() 공개 정적인 메소드

public static FromCenterAnd2Points ( Vector3D cen, Vector3D p1, Vector3D p2 ) : Circle3D
cen Vector3D
p1 Vector3D
p2 Vector3D
리턴 Circle3D
        public static Circle3D FromCenterAnd2Points( Vector3D cen, Vector3D p1, Vector3D p2 )
        {
            Circle3D circle = new Circle3D();
            circle.Center = cen;
            circle.Radius = ( p1 - cen ).Abs();

            if( !Tolerance.Equal( circle.Radius, ( p2 - cen ).Abs() ) )
                throw new System.ArgumentException( "Points are not on the same circle." );

            Vector3D normal = ( p2 - cen ).Cross( p1 - cen );
            normal.Normalize();
            circle.Normal = normal;
            return circle;
        }