public abstract class AbstractEllipse extends Object implements SolidShape, Serializable
This is an abstract describing class for an ellipse in 3D space, with some algorithm to compute intersections and distances to some other objects.
Shape.distanceTo(Line)
,
Shape.intersects(Line)
,
Serialized FormCreation with two radiuses, and two Vector3D : Vector3D center = new Vector3D(1.0, 6.0, -2.0); Vector3D normal = new Vector3D(6.0, -3.0, -1.0); double radiusA = 2.0; double radiusB = 5.0; Ellipse ellipse = new Ellipse(center, normal, radiusA, radiusB); Intersection with a line : boolean intersects = ellipse(line);
Constructor and Description |
---|
AbstractEllipse(Vector3D inCenter,
Vector3D inNormal,
Vector3D inUvector,
double inRadiusA,
double inRadiusB)
Build an ellipse in the 3D space from its center, normal vector, approximative U vector of the local frame, and
two radiuses.
|
Modifier and Type | Method and Description |
---|---|
Vector3D[] |
closestPointTo(Line line)
Computes the points of the shape and the line realizing
the shortest distance.
|
Vector3D |
closestPointTo(Vector3D point)
Computes the point on the ellipse closest to a point.
|
double |
distanceTo(Line line)
Computes the distance to a line.
|
double |
distanceTo(Vector3D point)
Computes the shortest distance from a point to the ellipse.
|
Vector3D |
getCenter() |
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line.
|
Vector3D |
getNormal() |
double |
getRadiusA() |
double |
getRadiusB() |
Vector3D |
getU() |
Vector3D |
getV() |
boolean |
intersects(Line line)
Tests the intersection with a line.
|
public AbstractEllipse(Vector3D inCenter, Vector3D inNormal, Vector3D inUvector, double inRadiusA, double inRadiusB)
inCenter
- position of the centerinNormal
- normal to the plane containing the ellipseinUvector
- approximative U vector of the local frame : corrected to be orthogonal to the normalinRadiusA
- radius on the U axis of the local frameinRadiusB
- radius on the V axis of the local frameIllegalArgumentException
- if one radius is'nt strictly positive, if the normal or the uVector has a not strictly positive norm,
or if they are parallel.public final Vector3D getCenter()
public final Vector3D getNormal()
public final double getRadiusA()
public final double getRadiusB()
public final Vector3D getU()
public final Vector3D getV()
public final boolean intersects(Line line)
intersects
in interface Shape
line
- the linepublic final Vector3D[] getIntersectionPoints(Line line)
getIntersectionPoints
in interface Shape
line
- the linepublic final double distanceTo(Line line)
distanceTo
in interface Shape
line
- the linepublic final double distanceTo(Vector3D point)
point
- the pointpublic final Vector3D closestPointTo(Vector3D point)
point
- the pointpublic final Vector3D[] closestPointTo(Line line)
closestPointTo
in interface Shape
line
- the lineCopyright © 2019 CNES. All Rights Reserved.