Class Cylinder
java.lang.Object
cnuphys.adaptiveSwim.geometry.Cylinder
A cylinder is defined by a centerline and a radius
- Author:
- heddle
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Cylinder
Create a cylinder- Parameters:
centerLine- the center lineradius- the radius
-
Cylinder
public Cylinder(double[] p1, double[] p2, double radius) Create a cylinder- Parameters:
p1- one point of center line as an xyz arrayp2- another point of center line as an xyz arrayradius-
-
-
Method Details
-
distance
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 coordinatey- the y coordinatez- the z coordinate- Returns:
- the perpendicular distance
-