|
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.Line
public final class Line
Constructor Summary | |
---|---|
Line(Vec4 origin,
Vec4 direction)
|
Method Summary | |
---|---|
static Vec4[] |
clipToFrustum(Vec4 pa,
Vec4 pb,
Frustum frustum)
Clip a line segment to a frustum, returning the end points of the portion of the segment that is within the frustum. |
double |
distanceTo(Vec4 p)
Calculate the shortests distance between this line and a specified Vec4 . |
static double |
distanceToSegment(Vec4 p0,
Vec4 p1,
Vec4 p)
|
boolean |
equals(Object o)
Performs a comparison to test whether this Object is internally identical to the other Object o . |
static Line |
fromSegment(Vec4 pa,
Vec4 pb)
Create the line containing a line segement between two points. |
Vec4 |
getDirection()
|
Vec4 |
getOrigin()
|
Vec4 |
getPointAt(double t)
|
int |
hashCode()
|
static Vec4 |
nearestPointOnSegment(Vec4 p0,
Vec4 p1,
Vec4 p)
|
Vec4 |
nearestPointTo(Vec4 p)
|
double |
selfDot()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Line(Vec4 origin, Vec4 direction)
origin
- direction
-
IllegalArgumentException
- if origin
is null, or direction
is null or has zero
lengthMethod Detail |
---|
public static Vec4[] clipToFrustum(Vec4 pa, Vec4 pb, Frustum frustum)
pa
- the first point of the segment.pb
- the second point of the segment.frustum
- the frustum.
public final double distanceTo(Vec4 p)
Vec4
. This method returns a
positive distance.
p
- the Vec4
whose distance from this Line
will be calculated
Line
and the specified Vec4
IllegalArgumentException
- if p
is nullpublic static double distanceToSegment(Vec4 p0, Vec4 p1, Vec4 p)
public final boolean equals(Object o)
o
.
This method takes into account both direction and origin, so two lines which may be equivalent may not be
considered equal.
equals
in class Object
o
- the object to be compared against.
public static Line fromSegment(Vec4 pa, Vec4 pb)
pa
- the first point of the line segment.pb
- the second point of the line segment.
IllegalArgumentException
- if either point is null or they are coincident.public final Vec4 getDirection()
public final Vec4 getOrigin()
public final Vec4 getPointAt(double t)
public final int hashCode()
hashCode
in class Object
public static Vec4 nearestPointOnSegment(Vec4 p0, Vec4 p1, Vec4 p)
public final Vec4 nearestPointTo(Vec4 p)
public final double selfDot()
public 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 |