Package cz.fidentis.analyst.data.shapes
Class Cylinder
java.lang.Object
cz.fidentis.analyst.data.shapes.Cylinder
- All Implemented Interfaces:
Serializable
A bounding cylinder.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsPoint
(javax.vecmath.Point3d testPoint) Determines if point is within cylinder.javax.vecmath.Vector3d
getAxis()
double
javax.vecmath.Point3d
javax.vecmath.Point3d
double
void
scale
(double factor) Scales the cylinder.
-
Constructor Details
-
Cylinder
public Cylinder(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2, double r) Constructor.- Parameters:
p1
- first point of axisp2
- second point of axisr
- radius
-
Cylinder
Copy constructor.- Parameters:
cylinder
- cylinder to copy
-
-
Method Details
-
getAxis
public javax.vecmath.Vector3d getAxis()- Returns:
- axis
-
getLengthSquared
public double getLengthSquared()- Returns:
- squared length of the axis
-
getPointA
public javax.vecmath.Point3d getPointA()- Returns:
- the first point of the axis
-
getPointB
public javax.vecmath.Point3d getPointB()- Returns:
- the second point of the axis
-
getRadius
public double getRadius()- Returns:
- radius
-
scale
public void scale(double factor) Scales the cylinder.- Parameters:
factor
- scale factor
-
containsPoint
public boolean containsPoint(javax.vecmath.Point3d testPoint) Determines if point is within cylinder. Based on: https://www.flipcode.com/archives/Fast_Point-In-Cylinder_Test.shtml- Parameters:
testPoint
- a 3D point to be tested- Returns:
true
if point is within the cylinder,false
otherwise.
-