public class Line extends AbstractLine implements Serializable
Modifier and Type | Field and Description |
---|---|
double |
x1
The x-coordinate of the start of this line segment.
|
double |
x2
The x-coordinate of the end of this line segment.
|
double |
y1
The y-coordinate of the start of this line segment.
|
double |
y2
The y-coordinate of the end of this line segment.
|
Constructor and Description |
---|
Line()
Creates a line from (0,0) to (0,0).
|
Line(double x1,
double y1,
double x2,
double y2)
Creates a line from (x1,y1), to (x2,y2).
|
Line(XY p1,
XY p2)
Creates a line from p1 to p2.
|
Modifier and Type | Method and Description |
---|---|
void |
setLine(double x1,
double y1,
double x2,
double y2)
Sets the start and end point of this line to the specified values.
|
void |
setLine(XY p1,
XY p2)
Sets the start and end of this line to the specified points.
|
double |
x1()
Returns the x-coordinate of the start of this line.
|
double |
x2()
Returns the x-coordinate of the end of this line.
|
double |
y1()
Returns the y-coordinate of the start of this line.
|
double |
y2()
Returns the y-coordinate of the end of this line.
|
bounds, bounds, clone, contains, contains, contains, contains, intersects, intersects, isEmpty, p1, p1, p2, p2, pathIterator, pathIterator, pointLineDist, pointLineDist, pointLineDistSq, pointLineDistSq, pointSegDist, pointSegDist, pointSegDistSq, pointSegDistSq, relativeCCW, relativeCCW
public double x1
public double y1
public double x2
public double y2
public Line()
public Line(double x1, double y1, double x2, double y2)
public void setLine(double x1, double y1, double x2, double y2)
public void setLine(XY p1, XY p2)
public double x1()
ILine
public double y1()
ILine
public double x2()
ILine
Copyright © 2017. All rights reserved.