public final class EllipticCylinder extends Object implements Cylinder, Serializable
This is a describing class for a 3D oblique circular cylinder ended by two planes 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 two radiuses, a height 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 radiusA = 2.0; double radiusB = 2.0; double height = 5.0; ObliqueCircularCylinder cylinder = new ObliqueCircularCylinder(origin, direction, uVector, radiusA, radiusB, length); Intersection with a line : boolean intersects = cylinder(line);
Constructor and Description |
---|
EllipticCylinder(Vector3D inOrigin,
Vector3D inDirection,
Vector3D inUvector,
double inRadiusA,
double inRadiusB,
double inHeight)
Build an oblique circular cylinder from its radiuses, the height, the origin, the approximative u vector of the
local frame and the 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.
|
Vector3D |
getDirection() |
double |
getHeight() |
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line.
|
Vector3D |
getOrigin() |
double |
getRadiusA() |
double |
getRadiusB() |
Vector3D |
getU() |
Vector3D |
getV() |
boolean |
intersects(Line line)
Tests the intersection with a line.
|
String |
toString()
Get a string representation for this elliptic cylinder.
|
public EllipticCylinder(Vector3D inOrigin, Vector3D inDirection, Vector3D inUvector, double inRadiusA, double inRadiusB, double inHeight)
inOrigin
- the origin of the axisinDirection
- the direction of the axisinUvector
- approximative U vector of the local frame : corrected to be orthogonal to the directioninRadiusA
- the angle of the cone on U directioninRadiusB
- the angle of the cone on V directioninHeight
- the height of the cone on its axisIllegalArgumentException
- if one radius or the height is negative or null, or if the direction vector or u vector has a null
norm, or if they are parallel.public double getHeight()
public double getRadiusA()
public double getRadiusB()
public Vector3D getOrigin()
public Vector3D getU()
public Vector3D getV()
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 © 2019 CNES. All rights reserved.