Class Cylinder

java.lang.Object
cnuphys.adaptiveSwim.geometry.Cylinder

public class Cylinder extends Object
A cylinder is defined by a centerline and a radius
Author:
heddle
  • Constructor Summary

    Constructors
    Constructor
    Description
    Cylinder(double[] p1, double[] p2, double radius)
    Create a cylinder
    Cylinder(Line centerLine, double radius)
    Create a cylinder
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    distance(double x, double y, double z)
    Get the shortest distance between the surface of this infinite cylinder and a point.
    double
    Get the shortest distance between the surface of this infinite cylinder and a point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Cylinder

      public Cylinder(Line centerLine, double radius)
      Create a cylinder
      Parameters:
      centerLine - the center line
      radius - the radius
    • Cylinder

      public Cylinder(double[] p1, double[] p2, double radius)
      Create a cylinder
      Parameters:
      p1 - one point of center line as an xyz array
      p2 - another point of center line as an xyz array
      radius -
  • Method Details

    • distance

      public double distance(Point p)
      Get the shortest distance between the surface of this infinite cylinder and a point. If the value is negative, we are inside the cylinder.
      Parameters:
      p - a point
      Returns:
      the perpendicular distance
    • distance

      public double distance(double x, double y, double z)
      Get the shortest distance between the surface of this infinite cylinder and a point. If the value is negative, we are inside the cylinder.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      the perpendicular distance