Module JNISpice
Package spice.basic

Class Plane


  • public class Plane
    extends java.lang.Object
    Class plane represents planes in 3-dimensional space and supports geometric operations using planes.

    Ray-plane intercept computations are performed by class RayPlaneIntercept.

    Limb computations are performed by class Ellipse.

    Ellipse-plane intersections are performed by class EllipsePlaneIntercept.

    Version 1.1.0 17-DEC-2017 (NJB)

    Bug fix: in constructor Plane(double[]), now uses double[] variable to capture normal vector contents from input array. This constructor now throws an exception if the input array has the wrong length.

    Version 1.0.0 08-DEC-2009 (NJB)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double constant  
      private Vector3 normal  
      private static int PLMAX  
    • Constructor Summary

      Constructors 
      Constructor Description
      Plane​(double[] planeArray)
      Contruct a Plane from a double array.The order of elements is the same as that used in SPICELIB planes.
      Plane​(Plane pl)
      Copy constructor: this constructor creates a deep copy.
      Plane​(Vector3 normal, double constant)
      Create a Plane from a normal vector and a constant.The Plane represents a 3-dimensional plane satisfying the plane equation
      Plane​(Vector3 normal, Vector3 point)
      Create a Plane from a normal vector and a point.The Plane represents a 3-dimensional plane satisfying the plane equation
      Plane​(Vector3 point, Vector3 span1, Vector3 span2)
      Create a Plane from a point and two spanning vectors.The Plane represents a 3-dimensional plane consisting of the set of points
    • Method Summary

      Modifier and Type Method Description
      double getConstant()
      Retrieve a plane constant from a Plane.The constant represents the distance of the Plane from the origin.
      Vector3 getNormal()
      Retrieve a normal vector from a Plane.The vector has unit length and points away from the origin.
      Vector3 getPoint()
      Retrieve a point from a Plane.The point closest to the origin is returned.
      Vector3[] getSpanningVectors()
      Retrieve two spanning vectors from a plane.
      Vector3 project​(Vector3 v)
      Project a vector orthogonally onto a Plane.The projection is the closest point in the plane to the input vector.
      double[] toArray()
      Extract contents of a Plane into a double array.The order of elements is the same as that used in SPICELIB planes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Plane

        public Plane​(Plane pl)
        Copy constructor: this constructor creates a deep copy.
        Parameters:
        pl - Plane
      • Plane

        public Plane​(Vector3 normal,
                     double constant)
              throws SpiceException
        Create a Plane from a normal vector and a constant.The Plane represents a 3-dimensional plane satisfying the plane equation
              &#60 x, normal &#62  = constant
           
        Parameters:
        normal - Vector3
        constant - double
        Throws:
        SpiceException - exception
      • Plane

        public Plane​(Vector3 normal,
                     Vector3 point)
              throws SpiceException
        Create a Plane from a normal vector and a point.The Plane represents a 3-dimensional plane satisfying the plane equation
              &#60 x, normal &#62  =  &#60 point, normal &#62
           
        Parameters:
        normal - Vector3
        point - Vector3
        Throws:
        SpiceException - exception
      • Plane

        public Plane​(Vector3 point,
                     Vector3 span1,
                     Vector3 span2)
              throws SpiceException
        Create a Plane from a point and two spanning vectors.The Plane represents a 3-dimensional plane consisting of the set of points
              point  +  s1 * span1  +  s2 * span2
           
        where s1, s2 are scalars.
        Parameters:
        point - Vector3
        span2 - Vector3
        span1 - Vector3
        Throws:
        SpiceException - exception
      • Plane

        public Plane​(double[] planeArray)
              throws SpiceException
        Contruct a Plane from a double array.The order of elements is the same as that used in SPICELIB planes.
        Parameters:
        planeArray - double[]
        Throws:
        SpiceException - exception
    • Method Detail

      • getNormal

        public Vector3 getNormal()
        Retrieve a normal vector from a Plane.The vector has unit length and points away from the origin.
        Returns:
        Vector3
      • getConstant

        public double getConstant()
        Retrieve a plane constant from a Plane.The constant represents the distance of the Plane from the origin. The plane is the set of points `x' satisfying the plane equation
              &#60 x, normal &#62  = constant
           
        where `normal' is the vector returned by `getNormal'.
        Returns:
        double
      • getPoint

        public Vector3 getPoint()
                         throws SpiceException
        Retrieve a point from a Plane.The point closest to the origin is returned.
        Returns:
        Vector3
        Throws:
        SpiceException - exception
      • getSpanningVectors

        public Vector3[] getSpanningVectors()
                                     throws SpiceException
        Retrieve two spanning vectors from a plane.
        Returns:
        Vector3[]
        Throws:
        SpiceException - exception
      • project

        public Vector3 project​(Vector3 v)
                        throws SpiceException
        Project a vector orthogonally onto a Plane.The projection is the closest point in the plane to the input vector.
        Parameters:
        v - Vector3
        Returns:
        Vector3
        Throws:
        SpiceException - exception
      • toArray

        public double[] toArray()
        Extract contents of a Plane into a double array.The order of elements is the same as that used in SPICELIB planes.
        Returns:
        double[]