|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.geom.Plane
public final class Plane
A Plane object represents a mathematical plane in an arbitrary cartesian co-ordinate system. A
Plane is defined by a normal vector and a distance along that vector from the origin, where the distance
represents the distance from the origin to the Plane rather than from the Plane to the
origin.
Plane are immutable.
| Constructor Summary | |
|---|---|
Plane(double a,
double b,
double c,
double d)
Obtains a new Plane whose normal is defined by the vector (a,b,c) and whose disance from that vector
is d. |
|
Plane(Vec4 vec)
Obtains a new instance of a Plane whose information is contained in Vector
vec. |
|
| Method Summary | |
|---|---|
Vec4[] |
clip(Vec4 pa,
Vec4 pb)
Clip a line segment to this plane. |
Plane |
computeParallelPlaneAtDistance(double distance)
|
double |
distanceTo(Vec4 p)
|
double |
dot(Vec4 p)
Calculates the dot product of this Plane with Vec4 p. |
boolean |
equals(Object o)
|
double |
getDistance()
Retrieves the distance from the origin to this Plane. |
Vec4 |
getNormal()
Retrieves a Vec4 representing the normal to this Plane. |
Vec4 |
getVector()
Retrieves a vector representing the normal and distance to this Plane. |
int |
hashCode()
|
Vec4 |
intersect(Line line)
Determine the point of intersection of a line with this plane. |
Vec4 |
intersect(Vec4 pa,
Vec4 pb)
Test a line segment for intersection with this plane. |
double |
intersectDistance(Line line)
Determine the parametric point of intersection of a line with this plane. |
int |
onSameSide(Vec4[] pts)
|
int |
onSameSide(Vec4 pa,
Vec4 pb)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Plane(double a,
double b,
double c,
double d)
Plane whose normal is defined by the vector (a,b,c) and whose disance from that vector
is d. The vector may not have zero length.
a - the x-parameter of the normal to this Planeb - the y-parameter of the normal to this Planec - the z-parameter of the normal to this Planed - the distance of this Plane from the origin along its normal.
IllegalArgumentException - if 0==a==b==cpublic Plane(Vec4 vec)
Plane whose information is contained in Vector
vec.
vec - the Vector containing information about this Plane's normal and distance
IllegalArgumentException - if passed a null or zero-length Vector| Method Detail |
|---|
public Vec4[] clip(Vec4 pa,
Vec4 pb)
pa - the first point of the segment.pb - the second point of the segment.
IllegalArgumentException - if either input point is null.public final Plane computeParallelPlaneAtDistance(double distance)
public double distanceTo(Vec4 p)
public final double dot(Vec4 p)
Plane with Vec4 p.
p - the Vec4 to dot with this Plane
p and this Plane
IllegalArgumentException - if p is nullpublic final boolean equals(Object o)
equals in class Objectpublic final double getDistance()
Plane. Two options exist for defining distance - the
first represents the distance from the origin to the Plane, the second represents the distance from
the Plane to the origin. This function uses the first method. The outcome of this is that depending
on the caller's view of this method, the sign of distances may appear to be reversed.
Plane and the originpublic final Vec4 getNormal()
Vec4 representing the normal to this Plane.
Vec4 representing the normal to this Planepublic final Vec4 getVector()
Plane. The vector has the structure
(x, y, z, distance), where (x, y, z) represents the normal, and distance represents the distance from the
origin.
Vector representation of this Planepublic final int hashCode()
hashCode in class Objectpublic Vec4 intersect(Line line)
line - the line to test
public Vec4 intersect(Vec4 pa,
Vec4 pb)
pa - the first point of the line segment.pb - the second point of the line segment.
Vec4.INFINITY coincident with the plane.
IllegalArgumentException - if either input point is null.public double intersectDistance(Line line)
line - the line to test
Double.NaN is
returned if the line does not intersect the plane. Double.POSITIVE_INFINITY is returned if the
line is coincident with the plane.public int onSameSide(Vec4[] pts)
public int onSameSide(Vec4 pa,
Vec4 pb)
public final String toString()
toString in class Object
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||