public final class SphericalCap extends Object implements SolidShape
This class implements the SolidShape interface, so it provides the expected : intersection with a line, distance from the surface of the shape, intersection points...
SolidShape
// A half-sphere :
// - sphere at the origin, radius 1.
// - plane (x,y), the normal is the z unit vector
final Sphere originSphere = new Sphere(new Vector3D(0., 0., 0.) , 1.);
final Plane xyPlane = new Plane(new Vector3D(0., 0., 1.));
final SphericalCap halfSphere = new SphericalCap(originSphere, xyPlane);
| Constructor and Description |
|---|
SphericalCap(Sphere s,
Plane p)
|
| Modifier and Type | Method and Description |
|---|---|
Vector3D[] |
closestPointTo(Line line)
Computes the points of the shape and the line realizing
the shortest distance.
|
double |
distanceTo(Line line)
Gives the distance from the line to the spherical cap.
|
Vector3D[] |
getIntersectionPoints(Line line)
Returns a list of intersection points between the line and the spherical cap.
|
boolean |
intersects(Line line)
Returns true when the line intersects the spherical cap.
|
String |
toString()
Get a representation for this sphere.
|
public SphericalCap(Sphere s, Plane p)
s - the sphere enclosing the spherical capp - plane delimiting the spherical cap.
This plane must intersect with the sphere by more than a single point, if not
the spherical cap is considered undefined. The direction of the plane is used to determine in which
side the
spherical cap is : it is on the side of the normal vector.public boolean intersects(Line line)
intersects in interface Shapeline - to intersectShape.intersects(Line)public double distanceTo(Line line)
distanceTo in interface Shapeline - to get the distance fromShape.distanceTo(Line)public Vector3D[] getIntersectionPoints(Line line)
getIntersectionPoints in interface Shapeline - to intersectShape.getIntersectionPoints(Line)public Vector3D[] closestPointTo(Line line)
closestPointTo in interface Shapeline - the lineCopyright © 2024 CNES. All rights reserved.