- java.lang.Object
-
- spice.basic.Ellipse
-
public class Ellipse extends java.lang.Object
Class Ellipse represents ellipses in 3-dimensional space and supports geometric operations using ellipses.Ellipses have a center and two orthogonal semi-axis vectors. The longer of these is called the "semi-major axis"; the shorter is called the "semi-minor axis."
Ellipses are allowed to be degenerate: one or both semi-axes may be the zero vector.
Ellipse-plane intersection computations are supported by class
EllipsePlaneIntercept
.Version 2.0.0 17-DEC-2016 (NJB)
Changed access of members from private to package private. Added no-arguments constructor.Version 1.0.0 09-DEC-2009 (NJB)
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Vector3
center
(package private) Vector3
semiMajorAxis
(package private) Vector3
semiMinorAxis
-
Constructor Summary
Constructors Constructor Description Ellipse()
No-arguments constructor.Ellipse(double[] elArray)
Create a Ellipse from a center and two generating vectors that have been packed into a double array, in that order.Ellipse(Ellipse el)
Copy constructor: this constructor creates a deep copy.Ellipse(Vector3 center, Vector3 gv1, Vector3 gv2)
Create a Ellipse from a center and two generating vectors.The Ellipse is the set of points `x' such that
-
Method Summary
Modifier and Type Method Description Vector3
getCenter()
Retrieve the center from an Ellipse.Vector3
getSemiMajorAxis()
Retrieve the semi-major axis from an Ellipse.Vector3
getSemiMinorAxis()
Retrieve the semi-minor axis from an Ellipse.Ellipse
project(Plane plane)
Project an Ellipse orthogonally onto a Plane.double[]
toArray()
Return the components of this ellipse in a double array.The array contains the ellipse's center, semi-major axis, and semi-minor axis, in that order.java.lang.String
toString()
Display an Ellipse as a string; override Object's toString() method.static Vector3[]
unpack(double[] elArray)
Unpack a double array into a center and generating vectors.
-
-
-
Constructor Detail
-
Ellipse
public Ellipse(Ellipse el)
Copy constructor: this constructor creates a deep copy.- Parameters:
el
- Ellipse
-
Ellipse
public Ellipse()
No-arguments constructor.
-
Ellipse
public Ellipse(Vector3 center, Vector3 gv1, Vector3 gv2) throws SpiceException
Create a Ellipse from a center and two generating vectors.The Ellipse is the set of points `x' such thatx = center + ( s * gv1 ) + ( t * gv2 )
where `s' and `t' are scalars.- Parameters:
center
- Vector3gv2
- Vector3gv1
- Vector3- Throws:
SpiceException
- exeption
-
Ellipse
public Ellipse(double[] elArray) throws SpiceException
Create a Ellipse from a center and two generating vectors that have been packed into a double array, in that order.- Parameters:
elArray
- double[]- Throws:
SpiceException
- exeption
-
-
Method Detail
-
getCenter
public Vector3 getCenter()
Retrieve the center from an Ellipse.- Returns:
- Vector3
-
getSemiMajorAxis
public Vector3 getSemiMajorAxis()
Retrieve the semi-major axis from an Ellipse.- Returns:
- Vector3
-
getSemiMinorAxis
public Vector3 getSemiMinorAxis()
Retrieve the semi-minor axis from an Ellipse.- Returns:
- Vector3
-
toArray
public double[] toArray()
Return the components of this ellipse in a double array.The array contains the ellipse's center, semi-major axis, and semi-minor axis, in that order.- Returns:
- double[]
-
project
public Ellipse project(Plane plane) throws SpiceException
Project an Ellipse orthogonally onto a Plane.- Parameters:
plane
- Plane- Returns:
- Ellipse
- Throws:
SpiceException
- exeption
-
toString
public java.lang.String toString()
Display an Ellipse as a string; override Object's toString() method.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String
-
unpack
public static Vector3[] unpack(double[] elArray)
Unpack a double array into a center and generating vectors.- Parameters:
elArray
- double[]- Returns:
- Vector3[]
-
-