public class Ellipsoid extends Object implements IEllipsoid, Serializable
This is the Ellipsoid (also called Revolved Ellipsoid) class.This class cannot represent all ellipsoid objects.
It creates an ellipsoid object.
Usage: With two Vector3D for position and Rev. Axis and three doubles for the three semi axes, call
IEllipsoid
,
SolidShape
,
Serialized FormConstructor and Description |
---|
Ellipsoid(Vector3D myPosition,
Vector3D myRevAxis,
Vector3D myXAxis,
double myA,
double myB,
double myC)
This constructor builds a ellipsoid from its centers position, its revolution axis and its transverse and
conjugate radii.
|
Modifier and Type | Method and Description |
---|---|
Vector3D[] |
closestPointTo(Line line)
This method computes the point on the line that is the closest to the ellipsoid.
|
Vector3D |
closestPointTo(Vector3D point)
Computes the point, on the ellipsoid surface, that is the closest to a point of space.
|
double |
distanceTo(Line line)
Get the smallest distance from the line to the ellipsoid.
|
double |
distanceTo(Vector3D point)
Computes the distance to the closest point on the ellipsoid.
|
Vector3D |
getAffineLocalExpression(Vector3D myVector)
Express a Vector3D in ellipsoid local basis.
|
Vector3D |
getAffineStandardExpression(Vector3D myVector)
Express a Vector3D in standard basis.
|
double[] |
getCartesianCoordinates(double theta,
double phi)
Convert from Ellipsoid to Cartesian coordinates
|
Vector3D |
getCenter()
Get ellipsoid center
|
double[] |
getEllipsoidicCoordinates(Vector3D point)
Convert from Cartesian to Ellipsoid coordinates
|
Vector3D[] |
getIntersectionPoints(Line line)
If more than one intersection points are found, the closest to the line's origin is returned first.
|
Matrix3D |
getLocalBasisTransform()
Get transformation matrix (from standard basis to ellipsoid local basis)
|
Vector3D |
getNormal(Vector3D point)
Computes the normal vector to the surface in local basis
|
double |
getSemiA()
Get the length of the semi principal axis X
|
double |
getSemiB()
Get the length of the semi principal axis Y
|
double |
getSemiC()
Get the length of the semi principal axis Z
|
Vector3D |
getSemiPrincipalX() |
Vector3D |
getSemiPrincipalY() |
Vector3D |
getSemiPrincipalZ() |
Matrix3D |
getStandardBasisTransform()
Get transformation matrix (from ellipsoid local basis to standard basis)
|
Vector3D |
getVectorialLocalExpression(Vector3D myVector)
Express a Vector3D in ellipsoid local basis.
|
Vector3D |
getVectorialStandardExpression(Vector3D myVector)
Express a Vector3D in standard basis.
|
boolean |
intersects(Line line)
This method returns true if the line intersects the ellipsoid.
|
void |
setNewtonThreshold(double newThreshold)
Setter for Newton algorithm threshold used to compute closest point and distance to the ellipsoid.
|
String |
toString()
Get a representation for this ellipsoid.
|
public Ellipsoid(Vector3D myPosition, Vector3D myRevAxis, Vector3D myXAxis, double myA, double myB, double myC)
myPosition
- The position of the ellipsoids centermyRevAxis
- The axis of revolution of the ellipsoidmyXAxis
- The axis of semi major axis a. Will be normalized and taken orthogonal to myRevAxis.myA
- Transverse radius : semi axis of the ellipsoid along a direction orthogonal to the axis of revolutionmyB
- Transverse radius : semi axis of the ellipsoid along a direction orthogonal to the axis of revolution
(orthogonal to myA direction)myC
- Conjugate radius : semi axis of the ellipsoid along the axis of revolutionIllegalArgumentException
- if semi-axis or norm of revolution axis is nullpublic Vector3D getSemiPrincipalX()
public Vector3D getSemiPrincipalY()
public Vector3D getSemiPrincipalZ()
public Vector3D getCenter()
getCenter
in interface IEllipsoid
public double getSemiA()
getSemiA
in interface IEllipsoid
public double getSemiB()
getSemiB
in interface IEllipsoid
public double getSemiC()
getSemiC
in interface IEllipsoid
public Matrix3D getStandardBasisTransform()
public Matrix3D getLocalBasisTransform()
public Vector3D getAffineLocalExpression(Vector3D myVector)
myVector
- Vector expressed in standard basispublic Vector3D getAffineStandardExpression(Vector3D myVector)
myVector
- Vector expressed in ellipsoid local basispublic Vector3D getVectorialLocalExpression(Vector3D myVector)
myVector
- Vector expressed in standard basispublic Vector3D getVectorialStandardExpression(Vector3D myVector)
myVector
- Vector expressed in ellipsoid local basispublic double[] getCartesianCoordinates(double theta, double phi)
theta
- theta angle in local basisphi
- phi anglepublic double[] getEllipsoidicCoordinates(Vector3D point)
point
- Point as a Vector3D in local basispublic Vector3D getNormal(Vector3D point)
getNormal
in interface IEllipsoid
point
- Point as a Vector3D in local basispublic Vector3D[] getIntersectionPoints(Line line)
Note: calculations take the line's minimum abscissa into account.
getIntersectionPoints
in interface Shape
line
- line with which the intersections are calculatedpublic boolean intersects(Line line)
Note: calculations take the line's minimum abscissa into account.
intersects
in interface Shape
line
- line for the computation of the intersectionpublic Vector3D closestPointTo(Vector3D point)
closestPointTo
in interface IEllipsoid
point
- the point expressed in standard basispublic double distanceTo(Vector3D point)
closestPointTo(Vector3D)
that computes the
coordinates of the closest point on the ellipsoid and returns the distance between the user point and the
returned point.point
- point coordinates in standard basispublic Vector3D[] closestPointTo(Line line)
Note: calculations take the line's minimum abscissa into account.
closestPointTo
in interface Shape
line
- line for the shortest distance computationVector3D
public double distanceTo(Line line)
Note: calculations take the line's minimum abscissa into account.
distanceTo
in interface Shape
line
- the linepublic void setNewtonThreshold(double newThreshold)
newThreshold
- new threshold to setCopyright © 2023 CNES. All rights reserved.