pythagoras.d

## Interface ILine

• ### Method Summary

All Methods
Modifier and Type Method and Description
`Line` `clone()`
Returns a mutable copy of this line.
`Point` `p1()`
Returns a copy of the starting point of this line.
`Point` `p1(Point target)`
Initializes the supplied point with this line's starting point.
`Point` `p2()`
Returns a copy of the ending point of this line.
`Point` `p2(Point target)`
Initializes the supplied point with this line's ending point.
`double` ```pointLineDist(double px, double py)```
Returns the distance from the specified point to the line defined by this line segment.
`double` `pointLineDist(XY p)`
Returns the distance from the supplied point to the line defined by this line segment.
`double` ```pointLineDistSq(double px, double py)```
Returns the square of the distance from the specified point to the line defined by this line segment.
`double` `pointLineDistSq(XY p)`
Returns the square of the distance from the supplied point to the line defined by this line segment.
`double` ```pointSegDist(double px, double py)```
Returns the distance from the specified point this line segment.
`double` `pointSegDist(XY p)`
Returns the distance from the supplied point this line segment.
`double` ```pointSegDistSq(double px, double py)```
Returns the square of the distance from the specified point this line segment.
`double` `pointSegDistSq(XY p)`
Returns the square of the distance from the supplied point this line segment.
`int` ```relativeCCW(double px, double py)```
Returns an indicator of where the specified point (px,py) lies with respect to this line segment.
`int` `relativeCCW(XY p)`
Returns an indicator of where the specified point lies with respect to this line segment.
`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 interface pythagoras.d.IShape

`bounds, bounds, contains, contains, contains, contains, intersects, intersects, isEmpty, pathIterator, pathIterator`
• ### Method Detail

• #### x1

`double x1()`
Returns the x-coordinate of the start of this line.
• #### y1

`double y1()`
Returns the y-coordinate of the start of this line.
• #### x2

`double x2()`
Returns the x-coordinate of the end of this line.
• #### y2

`double y2()`
Returns the y-coordinate of the end of this line.
• #### p1

`Point p1()`
Returns a copy of the starting point of this line.
• #### p1

`Point p1(Point target)`
Initializes the supplied point with this line's starting point.
Returns:
the supplied point.
• #### p2

`Point p2()`
Returns a copy of the ending point of this line.
• #### p2

`Point p2(Point target)`
Initializes the supplied point with this line's ending point.
Returns:
the supplied point.
• #### pointLineDistSq

```double pointLineDistSq(double px,
double py)```
Returns the square of the distance from the specified point to the line defined by this line segment.
• #### pointLineDistSq

`double pointLineDistSq(XY p)`
Returns the square of the distance from the supplied point to the line defined by this line segment.
• #### pointLineDist

```double pointLineDist(double px,
double py)```
Returns the distance from the specified point to the line defined by this line segment.
• #### pointLineDist

`double pointLineDist(XY p)`
Returns the distance from the supplied point to the line defined by this line segment.
• #### pointSegDistSq

```double pointSegDistSq(double px,
double py)```
Returns the square of the distance from the specified point this line segment.
• #### pointSegDistSq

`double pointSegDistSq(XY p)`
Returns the square of the distance from the supplied point this line segment.
• #### pointSegDist

```double pointSegDist(double px,
double py)```
Returns the distance from the specified point this line segment.
• #### pointSegDist

`double pointSegDist(XY p)`
Returns the distance from the supplied point this line segment.
• #### relativeCCW

```int relativeCCW(double px,
double py)```
Returns an indicator of where the specified point (px,py) lies with respect to this line segment.
• #### relativeCCW

`int relativeCCW(XY p)`
Returns an indicator of where the specified point lies with respect to this line segment.
• #### clone

`Line clone()`
Returns a mutable copy of this line.