Package cnuphys.adaptiveSwim.geometry
Class Sphere
java.lang.Object
cnuphys.adaptiveSwim.geometry.Sphere
A sphere centered at an arbitrary point
- Author:
- heddle
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Sphere
Create a sphere- Parameters:
center
- the center of the sphereradius
- the radius of the sphere
-
-
Method Details
-
distance
Get the shortest distance between the surface of this sphere and a point. If the value is negative, we are inside the sphere.- Parameters:
p
- a point- Returns:
- the distance to the sphere
-
distance
public double distance(double x, double y, double z) Get the shortest distance between the surface of this sphere and a point. If the value is negative, we are inside the sphere.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinate- Returns:
- the distance to the sphere
-