Package cnuphys.adaptiveSwim.geometry
Class Sphere
java.lang.Object
cnuphys.adaptiveSwim.geometry.Sphere
A sphere centered at an arbitrary point
- Author:
- heddle
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
SphereCreate a sphere- Parameters:
- center- the center of the sphere
- radius- the radius of the sphere
 
 
- 
- 
Method Details- 
distanceGet 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
 
- 
distancepublic 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 coordinate
- y- the y coordinate
- z- the z coordinate
- Returns:
- the distance to the sphere
 
 
-