- java.lang.Object
-
- spice.basic.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)
-
-
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 equationPlane(Vector3 normal, Vector3 point)
Create a Plane from a normal vector and a point.The Plane represents a 3-dimensional plane satisfying the plane equationPlane(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.
-
-
-
Field Detail
-
PLMAX
private static final int PLMAX
- See Also:
- Constant Field Values
-
normal
private Vector3 normal
-
constant
private double constant
-
-
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< x, normal > = constant
- Parameters:
normal
- Vector3constant
- 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< x, normal > = < point, normal >
- Parameters:
normal
- Vector3point
- 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 pointspoint + s1 * span1 + s2 * span2
where s1, s2 are scalars.- Parameters:
point
- Vector3span2
- Vector3span1
- 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< x, normal > = 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[]
-
-