|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.math3.geometry.euclidean.threed.Sphere
public final class Sphere
This is a describing class for a 3D spherical shape, with some algorithm to compute intersections and distances to some other objects.
Shape.distanceTo(Line)
,
Shape.intersects(Line)
,
Serialized FormCreation with a double and a Vector3D : Vector3D center = new Vector3D(1.0, 6.0, -2.0); Sphere sphere = new Sphere(center, 2.0); Intersection with a line : boolean intersects = sphere.intersects(line);
Constructor Summary | |
---|---|
Sphere(Vector3D inCenter,
double inRadius)
Build a sphere from its radius and the position of its center |
Method Summary | |
---|---|
Vector3D[] |
closestPointTo(Line line)
Computes the points of the shape and the line realizing the shortest distance. |
Vector3D |
closestPointTo(Vector3D point)
Computes the point, on the ellipsoid surface, that is the closest to a point of space. |
double |
distanceTo(Line line)
Computes the distance to a line. |
double |
distanceTo(Vector3D point)
Computes the distance to a point of space. |
Vector3D |
getCenter()
Get ellipsoids' center |
double |
getCrossSection(Vector3D direction)
Computes the cross section from the direction defined by a Vector3D. |
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line. |
Vector3D |
getNormal(Vector3D point)
Computes the normal vector to the surface |
double |
getRadius()
|
double |
getSemiA()
Get semi axis A |
double |
getSemiB()
Get semi axis B |
double |
getSemiC()
Get semi axis C |
boolean |
intersects(Line line)
Tests the intersection with a line. |
String |
toString()
Get a representation for this sphere. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Sphere(Vector3D inCenter, double inRadius)
inCenter
- the center of the sphereinRadius
- the radius of the sphere
IllegalArgumentException
- if the radius is negativeMethod Detail |
---|
public double getRadius()
public Vector3D getCenter()
IEllipsoid
getCenter
in interface IEllipsoid
public boolean intersects(Line line)
intersects
in interface Shape
line
- the line
public double distanceTo(Line line)
distanceTo
in interface Shape
line
- the line
public double distanceTo(Vector3D point)
point
- the point
public Vector3D[] getIntersectionPoints(Line line)
getIntersectionPoints
in interface Shape
line
- the line
public Vector3D[] closestPointTo(Line line)
closestPointTo
in interface Shape
line
- the line
public Vector3D closestPointTo(Vector3D point)
closestPointTo
in interface IEllipsoid
point
- the point expressed in standard basis
public Vector3D getNormal(Vector3D point)
getNormal
in interface IEllipsoid
point
- Point as a Vector3D
public String toString()
toString
in class Object
public double getCrossSection(Vector3D direction)
getCrossSection
in interface CrossSectionProvider
direction
- the direction vector
public double getSemiA()
getSemiA
in interface IEllipsoid
public double getSemiB()
getSemiB
in interface IEllipsoid
public double getSemiC()
getSemiC
in interface IEllipsoid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |