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) |
Modifier and Type | Method and Description |
---|---|
Angle |
angle() |
boolean |
equals(LineSegment ls) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
double |
length() |
Vect |
p1() |
Vect |
p2() |
java.awt.geom.Line2D.Double |
toLine2D() |
java.lang.String |
toString() |
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
l2d
public 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()
this
public Angle angle()
this
.public double length()
this
.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(LineSegment ls)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object