Class Cylinder

java.lang.Object
cz.fidentis.analyst.data.shapes.Cylinder
All Implemented Interfaces:
Serializable

public class Cylinder extends Object implements Serializable
A bounding cylinder.
See Also:
  • Constructor Details

    • Cylinder

      public Cylinder(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2, double r)
      Constructor.
      Parameters:
      p1 - first point of axis
      p2 - second point of axis
      r - radius
    • Cylinder

      public Cylinder(Cylinder 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.