org.starhope.appius.geometry
Class LineSeg2D

java.lang.Object
  extended by org.starhope.appius.geometry.LineSeg2D

public class LineSeg2D
extends Object

WRITEME: Document this type.

Author:
ewinkelman

Field Summary
(package private)  Coord2D point1
          Point 1
(package private)  Coord2D point2
          Point 2
 
Constructor Summary
LineSeg2D(Coord2D p1, Coord2D p2)
          Constructor
 
Method Summary
 Coord2D getPoint1()
           
 Coord2D getPoint2()
           
 Coord2D intersectionPoint(LineSeg2D lSeg2d)
          Gets the intersection point of two line segments
 boolean intersects(LineSeg2D lSeg2d)
          Determines if the line intersects another line
 double length()
           
 String toString()
           
 LineSeg2D translate(double x, double y)
          Creates a new line segment moved to the new position WRITEME: Document this method ewinkelman
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

point1

final Coord2D point1
Point 1


point2

final Coord2D point2
Point 2

Constructor Detail

LineSeg2D

public LineSeg2D(Coord2D p1,
                 Coord2D p2)
Constructor

Parameters:
p1 - Point One
p2 - Point Two
Method Detail

getPoint1

public Coord2D getPoint1()
Returns:
the first point

getPoint2

public Coord2D getPoint2()
Returns:
the second point

intersectionPoint

public Coord2D intersectionPoint(LineSeg2D lSeg2d)
Gets the intersection point of two line segments

Parameters:
lSeg2d - The line segment to test intersection with
Returns:
The point at which the lines intersect or null if they don't intersect

intersects

public boolean intersects(LineSeg2D lSeg2d)
Determines if the line intersects another line

Parameters:
lSeg2d - WRITEME
Returns:
WRITEME

length

public double length()
Returns:
WRITEME

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

translate

public LineSeg2D translate(double x,
                           double y)
Creates a new line segment moved to the new position WRITEME: Document this method ewinkelman

Parameters:
x - WRITEME
y - WRITEME
Returns:
WRITEME