public final class RectangleCone extends Object implements Cone, Serializable
This is a describing class for a 3D rectangle cone ended by a plane normal to its axis (pyramid), with some algorithm to compute intersections and distances to some other objects.
Shape.distanceTo(Line)
,
Shape.intersects(Line)
,
Serialized FormCreation with two dimensions, a length and three Vector3D : Vector3D origin = new Vector3D(1.0, 6.0, -2.0); Vector3D direction = new Vector3D(6.0, -3.0, -1.0); Vector3D uVector = new Vector3D(-5.0, 3.0, 0.0); double length = 2.0; double width = 4.0; double height = 5.0; RectangleCone cone = new RectangleCone(origin, direction, uVector, length, width, height); Intersection with a line : boolean intersects = cone(line);
Constructor and Description |
---|
RectangleCone(Vector3D inOrigin,
Vector3D inDirection,
Vector3D inUvector,
double inLength,
double inWidth,
double inHeight)
Build a rectangle cone from its apex (origin), axis' direction, approximative U vector of the local frame and
dimensions.
|
Modifier and Type | Method and Description |
---|---|
Vector3D[] |
closestPointTo(Line line)
Computes the points of the shape and the line realizing
the shortest distance.
|
double |
distanceTo(Line line)
Computes the distance to a line.
|
Vector3D |
getDirection() |
double |
getHeight() |
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line.
|
double |
getLength() |
Vector3D |
getOrigin() |
Vector3D |
getU() |
Vector3D |
getV() |
double |
getWidth() |
boolean |
intersects(Line line)
Tests the intersection with a line.
|
String |
toString()
Get a representation for this rectangle cone.
|
public RectangleCone(Vector3D inOrigin, Vector3D inDirection, Vector3D inUvector, double inLength, double inWidth, double inHeight)
inOrigin
- the cone's origininDirection
- the cone's directioninUvector
- the cone's approximative U vector : corrected to be orthogonal to the directioninLength
- the basis' lengthinWidth
- the basis' widthinHeight
- the cone's height on its axispublic Vector3D getOrigin()
public double getHeight()
public double getLength()
public double getWidth()
public Vector3D getDirection()
public Vector3D getU()
public Vector3D getV()
public boolean intersects(Line line)
intersects
in interface Shape
line
- the linepublic Vector3D[] getIntersectionPoints(Line line)
getIntersectionPoints
in interface Shape
line
- the linepublic double distanceTo(Line line)
distanceTo
in interface Shape
line
- the linepublic Vector3D[] closestPointTo(Line line)
closestPointTo
in interface Shape
line
- the lineCopyright © 2021 CNES. All rights reserved.