|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Line2D
java.awt.geom.Line2D.Float
lejos.geom.Line
public class Line
Represents a line and supports calculating the point of intersection of two line segments.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Line2D |
---|
Line2D.Double, Line2D.Float |
Field Summary |
---|
Fields inherited from class java.awt.geom.Line2D.Float |
---|
x1, x2, y1, y2 |
Constructor Summary | |
---|---|
Line(float x1,
float y1,
float x2,
float y2)
|
Method Summary | |
---|---|
Point |
getP1()
Get the start point of the line as a Point2D |
Point |
getP2()
Get the end point of the line as a Point2D |
Point |
intersectsAt(Line l)
Calculate the point of intersection of two lines. |
float |
length()
Return the length of the line |
void |
lengthen(float delta)
Make this line longer by an amount delta at each end. |
double |
segDist(Line seg)
Returns the minimum distance between two line segments--this line segment and another. |
Methods inherited from class java.awt.geom.Line2D.Float |
---|
getBounds2D, getX1, getX2, getY1, getY2, setLine, setLine |
Methods inherited from class java.awt.geom.Line2D |
---|
clone, contains, contains, contains, contains, getBounds, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Line(float x1, float y1, float x2, float y2)
Method Detail |
---|
public Point intersectsAt(Line l)
l
- the second line
public double segDist(Line seg)
seg
- The other line segment.
public void lengthen(float delta)
delta
- the amount added to each endpublic float length()
public Point getP1()
Line2D
getP1
in class Line2D.Float
public Point getP2()
Line2D
getP2
in class Line2D.Float
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |