subscript.geom
Class GLineSegment2D
java.lang.Object
subscript.geom.GLineSegment2D
- All Implemented Interfaces:
- java.io.Serializable
public class GLineSegment2D
- extends java.lang.Object
- implements java.io.Serializable
A 2D line with end points.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
line
public transient GLine2D line
p1
public GPoint2D p1
p2
public GPoint2D p2
weight
public int weight
GLineSegment2D
public GLineSegment2D(GPoint2D p1,
GPoint2D p2)
getLine
public GLine2D getLine()
intersectionWith
public GPoint2D intersectionWith(GLine2D l)
- Returns the point where this segment intersects this line, or null
if they do not intersect.
intersectionWith
public GPoint2D intersectionWith(GLineSegment2D seg)
closestPoint
public GPoint2D closestPoint(GPoint2D p)
squaredDistanceTo
public double squaredDistanceTo(GPoint2D p)
length
public double length()
distanceTo
public double distanceTo(GPoint2D p)
transform
public GLineSegment2D transform(Matrix P)
transformSegments
public static java.util.ArrayList<GLineSegment2D> transformSegments(java.util.ArrayList<GLineSegment2D> segs,
Matrix P)
lengthOfProjectionOnto
public double lengthOfProjectionOnto(GLineSegment2D seg)