|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.math.Ellipsoid
public final class Ellipsoid
Provides an ellipsoid. The ellipsoid equation is x^2/A^2 + y^2/B^2 + z^2/C^2 = 1. This class assumes the ellipsoid is centered at (0,0,0) and A, B, and C are oriented along the X, Y, and Z axes respectively. Vector parameters must be expressed in this ellipsoid coordinate system. Note that if A == B == C, then the ellipsoid devolves into a sphere.
Constructor Summary | |
---|---|
Ellipsoid(double r)
Construct this object as a sphere using the given parameter. |
|
Ellipsoid(double a,
double b,
double c)
Construct this object using the given parameters. |
Method Summary | |
---|---|
boolean |
contains(Vector v)
Return true if the given point is inside or on the surface of this ellipsoid. |
double |
ellipsoidEquation(Vector v)
Return the result of using the given vector in the ellipsoid equation x^2/A^2 + y^2/B^2 + z^2/C^2. |
boolean |
equals(Object object)
Return true if this ellipsoid equals the given object. |
boolean |
equals(Object object,
double delta)
Return true if this ellipsoid equals the given object. |
double |
getA()
Return the A component. |
double |
getB()
Return the B component. |
double |
getC()
Return the C component. |
int |
hashCode()
Return a hash code. |
double[] |
intersectionParameters(Vector v0,
Vector v1)
Return the intersection parameter(s) of the line described by the input vectors. |
double[] |
intersectionParameters(Vector v0,
Vector v1,
boolean beforeStart,
boolean afterEnd)
Return the intersection parameter(s) of the line described by the input vectors. |
Vector[] |
intersections(Ellipsoid other)
Return the intersection point(s) of the given ellipsoid and this. |
Vector[] |
intersections(Vector v0,
Vector v1)
Return the intersection point(s) of the line described by the input vectors. |
Vector[] |
intersections(Vector v0,
Vector v1,
boolean beforeStart,
boolean afterEnd)
Return the intersection point(s) of the line described by the input vectors. |
boolean |
intersects(Ellipsoid other)
Return true if the given ellipsoid intersects this. |
boolean |
intersects(Vector v0,
Vector v1)
Return true if the line described by the parameters intersects this ellipsoid. |
String |
toString()
Return a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Ellipsoid(double r)
r
- Radius of sphere.public Ellipsoid(double a, double b, double c)
Method Detail |
---|
public boolean contains(Vector v)
v
- Point of interest in ellipsoid coordinates.public double ellipsoidEquation(Vector v)
v
- Point of interest in ellipsoid coordinates.public boolean equals(Object object)
equals
in class Object
object
- Object to compare.public boolean equals(Object object, double delta)
object
- Object to compare.delta
- Allowable difference in coordinates.public double getA()
public double getB()
public double getC()
public int hashCode()
hashCode
in class Object
public double[] intersectionParameters(Vector v0, Vector v1)
v0
- Start of line in ellipsoid coordinates.v1
- End of line in ellipsoid coordinates.
intersectionParameters(Vector,Vector,boolean,boolean)
public double[] intersectionParameters(Vector v0, Vector v1, boolean beforeStart, boolean afterEnd)
v0
- Start of line in ellipsoid coordinates.v1
- End of line in ellipsoid coordinates.beforeStart
- Flag indicating whether to include intersection
parameters before the start vector.afterEnd
- Flag indicating whether to include intersection
parameters after the end vector.
public Vector[] intersections(Ellipsoid other)
other
- Other ellipsoid.
intersections(Vector,Vector,boolean,boolean)
public Vector[] intersections(Vector v0, Vector v1)
intersections(Vector,Vector,boolean,boolean)
.
v0
- Start of line in ellipsoid coordinates.v1
- End of line in ellipsoid coordinates.
intersections(Vector,Vector,boolean,boolean)
public Vector[] intersections(Vector v0, Vector v1, boolean beforeStart, boolean afterEnd)
v0
- Start of line in ellipsoid coordinates.v1
- End of line in ellipsoid coordinates.beforeStart
- Flag indicating whether to include intersection
parameters before the start vector.afterEnd
- Flag indicating whether to include intersection
parameters after the end vector.
public boolean intersects(Ellipsoid other)
other
- Other ellipsoid.public boolean intersects(Vector v0, Vector v1)
v0
- Start of line in ellipsoid coordinates.v1
- End of line in ellipsoid coordinates.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |