public final class RightCircularCone extends Object implements Cone, Serializable
This is a describing class for a 3D right circular cone ended by a plane normal to its axis, with some algorithm to compute intersections and distances to some other objects.
Shape.distanceTo(Line)
,
Shape.intersects(Line)
,
Serialized FormCreation with an angle, a height and two Vector3D : Vector3D origin = new Vector3D(1.0, 6.0, -2.0); Vector3D direction = new Vector3D(6.0, -3.0, -1.0); double angle = 2.0; double height = 5.0; EllipticCone cone = new EllipticCone(origin, direction, angle, height); Intersection with a line : boolean intersects = cone(line);
Constructor and Description |
---|
RightCircularCone(Vector3D inOrigin,
Vector3D inDirection,
double inAngle,
double inLength)
Build a elliptic cone from its radius, the height, the origin (apex) and direction of its axis
|
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.
|
double |
getAngle() |
Vector3D |
getDirection() |
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line.
|
double |
getLength() |
Vector3D |
getOrigin() |
boolean |
intersects(Line line)
Tests the intersection with a line.
|
String |
toString()
Get a representation for this elliptic cone.
|
public RightCircularCone(Vector3D inOrigin, Vector3D inDirection, double inAngle, double inLength)
inOrigin
- the origin of the axisinDirection
- the direction of the axisinAngle
- the angle of the coneinLength
- the height of the cone on its axisIllegalArgumentException
- if the angle or the height is negative or null, or if the direction vector has a null norm.public double getLength()
public Vector3D getOrigin()
public double getAngle()
public Vector3D getDirection()
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 © 2023 CNES. All rights reserved.