gov.nasa.worldwind.geom
Class Line
java.lang.Object
gov.nasa.worldwind.geom.Line
public final class Line
- extends Object
Line
public Line(Point origin,
Point direction)
- Parameters:
origin - direction -
- Throws:
IllegalArgumentException - if origin is null, or direction is null or has zero
length
distanceTo
public final double distanceTo(Point p)
- Calculate the shortests distance between this line and a specified
Point. This method returns a
positive distance.
- Parameters:
p - the Point whose distance from this Line will be calculated
- Returns:
- the distance between this
Line and the specified Point
- Throws:
IllegalArgumentException - if p is null
equals
public final boolean equals(Object o)
- Performs a comparison to test whether this Object is internally identical to the other Object
o.
This method takes into account both direction and origin, so two lines which may be equivalent may not be
considered equal.
- Overrides:
equals in class Object
- Parameters:
o - the object to be compared against.
- Returns:
- true if these two objects are equal, false otherwise
getDirection
public final Point getDirection()
getOrigin
public final Point getOrigin()
getPointAt
public final Point getPointAt(double t)
hashCode
public final int hashCode()
- Overrides:
hashCode in class Object
selfDot
public final double selfDot()
toString
public String toString()
- Overrides:
toString in class Object