|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspice.basic.EllipsoidPlaneIntercept
public class EllipsoidPlaneIntercept
Class EllipsoidPlaneIntercept represents the result of a ellipsoid-plane intercept computation.
Each EllipsoidPlaneIntercept instance consists of
Applications using this class should call the wasFound
method before attempting to retrieve the intersection Ellipse.
The getIntercept()
method will throw a
PointNotFoundException
if it is called on an EllipsoidPlaneIntercept instance
for which the intercept does not exist.
To find the ellipsoid-plane intersection in the special case
where the plane is the limb plane for a specified view point,
use the method Ellipsoid.getLimb(Vector3)
.
For high-level limb computations for which the observer
and target are specified as Body
instances, use the
method LimbPoint.create(java.lang.String, spice.basic.Body, spice.basic.Time, spice.basic.ReferenceFrame, spice.basic.AberrationCorrection, java.lang.String, spice.basic.Body, spice.basic.Vector3, double, int, double, double, int)
.
Example code starts here.
// // Program EllipsoidPlaneInterceptEx1 // import spice.basic.*; // // Compute an Ellipsoid-Plane intercept using a known // limb plane for a given view point. Compare the resulting // ellipse to the limb. // public class EllipsoidPlaneInterceptEx1 { // // Load SPICE shared library. // static{ System.loadLibrary( "JNISpice" ); } public static void main( String[] args ) throws SpiceException { // // Local variables // Ellipse limb; Ellipsoid ellipsoid; EllipsoidPlaneIntercept intercept; Plane limbPlane; Vector3 centerLimb; Vector3 centerIntercept; Vector3 smajorLimb; Vector3 smajorIntercept; Vector3 sminorLimb; Vector3 sminorIntercept; Vector3 viewpt; double a; double b; double c; try { // // Choose semi-axis lengths of a triaxial ellipsoid. // a = 5000.0; b = 3000.0; c = 1000.0; ellipsoid = new Ellipsoid( a, b, c ); viewpt = new Vector3( -7000.0, 6000.0, 2000.0 ); // // Find the limb of the ellipsoid as seen from `viewpt'. // Extract the center and semi-axes of the limb. // limb = ellipsoid.getLimb( viewpt ); centerLimb = limb.getCenter(); smajorLimb = limb.getSemiMajorAxis(); sminorLimb = limb.getSemiMinorAxis(); // // Construct the limb plane from the center and the semi-axes, // which serve as spanning vectors. // limbPlane = new Plane( centerLimb, smajorLimb, sminorLimb ); // // Compute the ellipsoid-plane intercept using the // limb plane and the ellipsoid. // intercept = new EllipsoidPlaneIntercept( ellipsoid, limbPlane ); // // Compare the limb and the intercept we just computed. // centerLimb = limb.getCenter(); smajorLimb = limb.getSemiMajorAxis(); sminorLimb = limb.getSemiMinorAxis(); centerIntercept = intercept.getIntercept().getCenter(); smajorIntercept = intercept.getIntercept().getSemiMajorAxis(); sminorIntercept = intercept.getIntercept().getSemiMinorAxis(); // // Adjust intercept semi-axes if they're not aligned with // those of the limb. The semi-axes are determined only up // to sign. // if ( smajorLimb.dot( smajorIntercept ) < 0.0 ) { smajorIntercept = smajorIntercept.negate(); } if ( sminorLimb.dot( sminorIntercept ) < 0.0 ) { sminorIntercept = sminorIntercept.negate(); } System.out.format ( "%n" ); System.out.println( " Difference of ellipse centers = \n " + centerLimb.sub( centerIntercept ) ); System.out.println( " Difference of ellipse semi-major axes = \n " + smajorLimb.sub( smajorIntercept ) ); System.out.println( " Difference of ellipse semi-minor axes = \n " + sminorLimb.sub( sminorIntercept ) ); System.out.format ( "%n" ); } // End of try block catch ( SpiceException exc ) { exc.printStackTrace(); } } // End of main method }
When this program was executed on a PC/Linux/gcc/64-bit/java 1.5 platform, the output was:
Difference of ellipse centers = ( 2.2737367544323206e-13, -2.2737367544323206e-13, 2.8421709430404007e-14) Difference of ellipse semi-major axes = ( 0.0000000000000000e+00, -4.5474735088646410e-13, 2.8421709430404007e-14) Difference of ellipse semi-minor axes = ( 5.6843418860808015e-14, -4.5474735088646410e-13, 0.0000000000000000e+00)
Constructor Summary | |
---|---|
EllipsoidPlaneIntercept()
No-arguments constructor. |
|
EllipsoidPlaneIntercept(Ellipsoid ellipsoid,
Plane plane)
Construct an Ellipsoid-Plane intercept from an Ellipsoid and a Plane. |
|
EllipsoidPlaneIntercept(EllipsoidPlaneIntercept epx)
Copy constructor. |
Method Summary | |
---|---|
Ellipse |
getIntercept()
Fetch the intercept. |
boolean |
wasFound()
Indicate whether an intersection exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EllipsoidPlaneIntercept(Ellipsoid ellipsoid, Plane plane) throws SpiceException
SpiceException
public EllipsoidPlaneIntercept()
public EllipsoidPlaneIntercept(EllipsoidPlaneIntercept epx) throws PointNotFoundException
PointNotFoundException
Method Detail |
---|
public boolean wasFound()
public Ellipse getIntercept() throws PointNotFoundException
This method returns a deep copy.
PointNotFoundException
|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |