pythagoras.d

## Class Line

• ### Field Summary

Fields
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 Summary

Constructors
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.
• ### Method Summary

All Methods
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.
• ### Methods inherited from class pythagoras.d.AbstractLine

`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`
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### x1

`public double x1`
The x-coordinate of the start of this line segment.
• #### y1

`public double y1`
The y-coordinate of the start of this line segment.
• #### x2

`public double x2`
The x-coordinate of the end of this line segment.
• #### y2

`public double y2`
The y-coordinate of the end of this line segment.
• ### Constructor Detail

• #### Line

`public Line()`
Creates a line from (0,0) to (0,0).
• #### Line

```public Line(double x1,
double y1,
double x2,
double y2)```
Creates a line from (x1,y1), to (x2,y2).
• #### Line

```public Line(XY p1,
XY p2)```
Creates a line from p1 to p2.
• ### Method Detail

• #### setLine

```public void setLine(double x1,
double y1,
double x2,
double y2)```
Sets the start and end point of this line to the specified values.
• #### setLine

```public void setLine(XY p1,
XY p2)```
Sets the start and end of this line to the specified points.
• #### x1

`public double x1()`
Description copied from interface: `ILine`
Returns the x-coordinate of the start of this line.
Specified by:
`x1` in interface `ILine`
• #### y1

`public double y1()`
Description copied from interface: `ILine`
Returns the y-coordinate of the start of this line.
Specified by:
`y1` in interface `ILine`
• #### x2

`public double x2()`
Description copied from interface: `ILine`
Returns the x-coordinate of the end of this line.
Specified by:
`x2` in interface `ILine`
• #### y2

`public double y2()`
Description copied from interface: `ILine`
Returns the y-coordinate of the end of this line.
Specified by:
`y2` in interface `ILine`