Line2D.Double, Line2D.Float
Modifier and Type | Field and Description |
---|---|
float |
x1
The x coordinate of the start of the line
|
float |
x2
The x coordinate of the end of the line
|
float |
y1
The y coordinate of the start of the line
|
float |
y2
The y coordinate of the end of the line
|
Constructor and Description |
---|
Float()
Creates a zero length line at (0,0)
|
Float(float x1,
float y1,
float x2,
float y2)
Create a line from (x1,y1) to (x2,y2)
|
Modifier and Type | Method and Description |
---|---|
Rectangle2D |
getBounds2D()
Get the bounds of the line as a Rectangle2D
|
Point2D |
getP1()
Get the start point of the line as a Point2D
|
Point2D |
getP2()
Get the end point of the line as a Point2D
|
double |
getX1()
Get the x coordinate of the start of the line
|
double |
getX2()
Get the x coordinate of the end of the line
|
double |
getY1()
Get the y coordinate of the start of the line
|
double |
getY2()
Get the y coordinate of the end of the line
|
void |
setLine(double x1,
double y1,
double x2,
double y2)
Sets the end points of the line using double coordinates.
|
void |
setLine(float x1,
float y1,
float x2,
float y2)
Set the float coordinates of the start and end of the line
|
clone, contains, contains, contains, contains, getBounds, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine
public float x1
public float y1
public float x2
public float y2
public Float()
public Float(float x1, float y1, float x2, float y2)
x1
- the x coordinate of the start of the liney1
- the y coordinate of the start of the linex2
- the x coordinate of the end of the liney2
- the y coordinate of the end of the linepublic void setLine(float x1, float y1, float x2, float y2)
x1
- the x coordinate of the start of the liney1
- the y coordinate of the start of the linex2
- the x coordinate of the end of the liney2
- the y coordinate of the end of the linepublic Rectangle2D getBounds2D()
public double getX1()
Line2D
public double getY1()
Line2D
public Point2D getP1()
Line2D
public double getX2()
Line2D
public double getY2()
Line2D
public Point2D getP2()
Line2D
public void setLine(double x1, double y1, double x2, double y2)
Line2D