|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ProGAL.geom3d.volumes.Sphere
public class Sphere
A sphere represented by a center-point and a radius.
Constructor Summary | |
---|---|
Sphere(Circle c)
creates a sphere with the specified circle as equator |
|
Sphere(CTetrahedron tetr)
|
|
Sphere(Point[] points)
|
|
Sphere(Point center,
double radius)
Constructs a sphere with the specified center and the specified radius. |
|
Sphere(Point p0,
Point p1,
Point p2,
Point p3)
|
|
Sphere(PointWeighted p)
Constructs a sphere with the weighted point as center and a radius with the square root of the points weight. |
Method Summary | |
---|---|
Sphere |
clone()
Returns a deep clone of this sphere. |
boolean |
contains(Point p)
Returns true if the given point is in the sphere. |
boolean |
containsNone(java.util.List<Point> points)
Returns true if none of the given points is in the sphere. |
PointList |
generatePointsOnSphere(int n)
TODO: Comment, move up and test |
PointList |
generateRandomPointsOnSphere(int n)
TODO: Comment, move up and test |
Point |
getCenter()
Get the center |
LineSegment |
getIntersection(Line line)
Gets the secant on the line. |
java.lang.Double |
getIntersectionAngle(Circle c,
Point p,
Vector dir)
|
Point[] |
getIntersections(Circle c)
|
static Point[] |
getIntersections(Sphere s1,
Sphere s2,
Sphere s3)
Find the two, one or zero points that is at the intersection of the three sphere shells. |
static Sphere |
getMinSphere(Circle c)
Get the sphere with the specified circle as equator |
static Sphere |
getMinSphere(PointList points)
Gets the smallest sphere containing a set of points. |
static Sphere |
getMinSphere(Point p1,
Point p2)
Get the smallest sphere through two given points. |
static Sphere |
getMinSphere(Point p0,
Point p1,
Point p2)
Get the smallest sphere through three points. |
static Sphere |
getMinSphere(Point p0,
Point p1,
Point p2,
Point p3)
Constructs the sphere through four points. |
double |
getRadius()
Get the radius |
double |
getRadiusSquared()
Get the squared radius |
double |
getSurfaceArea()
Get the surface area |
double |
getVolume()
Get the volume |
double[] |
intersectionParameters(Line line)
Returns the two line-parameters that indicate where line intersects
this sphere. |
boolean |
isEmpty(Point[] points,
double eps)
|
boolean |
isInside(Point p)
Returns true if the point is inside this sphere |
boolean |
isInside(Point p,
double eps)
|
boolean |
isIntersected(Sphere sphere)
Returns true if this sphere is intersected or touched by another sphere. |
static void |
main(java.lang.String[] args)
|
boolean |
overlaps(Volume vol)
Returns true if the sphere overlaps with vol . |
double |
powerDistance(Point p)
Gets the squared distance of a point from a sphere surface (negative if the point is inside the sphere). |
void |
setCenter(Point center)
|
void |
setCenter(Point p0,
Point p1,
Point p2,
Point p3)
|
void |
setRadius(double radius)
|
void |
toConsole()
Writes this sphere to System.out . |
void |
toConsole(int dec)
Writes this sphere to System.out with dec decimals precision. |
void |
toScene(J3DScene scene,
java.awt.Color clr)
|
java.lang.String |
toString()
Return a string representation of this sphere. |
java.lang.String |
toString(int dec)
Return a string representation of this sphere with dec decimals precision |
static double |
unionVolume_Grid(java.util.Collection<Sphere> spheres)
Estimate the volume of the union of a set of spheres. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Sphere(Point center, double radius)
public Sphere(Point[] points)
public Sphere(Point p0, Point p1, Point p2, Point p3)
public Sphere(CTetrahedron tetr)
public Sphere(PointWeighted p)
public Sphere(Circle c)
Method Detail |
---|
public Point getCenter()
getCenter
in interface Shape
public double getRadius()
public double getRadiusSquared()
public double getSurfaceArea()
public double getVolume()
getVolume
in interface Volume
public boolean isInside(Point p)
public boolean isInside(Point p, double eps)
public boolean isEmpty(Point[] points, double eps)
public void setCenter(Point center)
public void setCenter(Point p0, Point p1, Point p2, Point p3)
public void setRadius(double radius)
public boolean isIntersected(Sphere sphere)
public LineSegment getIntersection(Line line)
public double[] intersectionParameters(Line line)
line
intersects
this sphere. TODO: Coordinate line-intersection methods (see above).
public Point[] getIntersections(Circle c)
public java.lang.Double getIntersectionAngle(Circle c, Point p, Vector dir)
public boolean containsNone(java.util.List<Point> points)
public boolean contains(Point p)
public double powerDistance(Point p)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int dec)
dec
decimals precision
public void toConsole()
System.out
.
public void toConsole(int dec)
System.out
with dec
decimals precision.
public void toScene(J3DScene scene, java.awt.Color clr)
public boolean overlaps(Volume vol)
vol
. TODO: Implement for all volumes.
overlaps
in interface Volume
public Sphere clone()
clone
in interface Volume
clone
in class java.lang.Object
public static Sphere getMinSphere(Circle c)
public static Sphere getMinSphere(Point p1, Point p2)
public static Sphere getMinSphere(Point p0, Point p1, Point p2)
public static Sphere getMinSphere(Point p0, Point p1, Point p2, Point p3)
public static Sphere getMinSphere(PointList points)
public static Point[] getIntersections(Sphere s1, Sphere s2, Sphere s3)
public static void main(java.lang.String[] args)
public static double unionVolume_Grid(java.util.Collection<Sphere> spheres)
public PointList generateRandomPointsOnSphere(int n)
public PointList generatePointsOnSphere(int n)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |