public final class LineSegment
extends java.lang.Object
| Constructor and Description |
|---|
LineSegment(double x1,
double y1,
double x2,
double y2)
Constructs a new line segment from <
x1,
y1> to <x2, y2>. |
LineSegment(java.awt.geom.Line2D l2d) |
LineSegment(Vect p1,
Vect p2) |
public LineSegment(Vect p1, Vect p2)
p1 - ; requires that p1 is not nullp2 - ; requires that p2 is not null
Constructs a new LineSegment between the two points
p1 and p2.public LineSegment(java.awt.geom.Line2D l2d)
l2d - Line2D to create a line segment of; requires that
l2d is not null
Constructs a new Line Segment with the same coordinates as
l2dpublic LineSegment(double x1,
double y1,
double x2,
double y2)
x1,
y1> to <x2, y2>.public Vect p1()
this line segment.public Vect p2()
this line segment.public java.awt.geom.Line2D.Double toLine2D()
thispublic Angle angle()
this.public double length()
this.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(LineSegment ls)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object