pythagoras.d

## Class Lines

• ```public class Lines
extends Object```
Line-related utility methods.
• ### Constructor Summary

Constructors
Constructor and Description
`Lines()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static boolean` ```lineIntersectsRect(double x1, double y1, double x2, double y2, double rx, double ry, double rw, double rh)```
Returns true if the specified line segment intersects the specified rectangle.
`static boolean` ```linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)```
Returns true if the specified two line segments intersect.
`static double` ```pointLineDist(double px, double py, double x1, double y1, double x2, double y2)```
Returns the distance from the specified point to the specified line.
`static double` ```pointLineDistSq(double px, double py, double x1, double y1, double x2, double y2)```
Returns the square of the distance from the specified point to the specified line.
`static double` ```pointSegDist(double px, double py, double x1, double y1, double x2, double y2)```
Returns the distance between the specified point and the specified line segment.
`static double` ```pointSegDistSq(double px, double py, double x1, double y1, double x2, double y2)```
Returns the square of the distance between the specified point and the specified line segment.
`static int` ```relativeCCW(double px, double py, double x1, double y1, double x2, double y2)```
Returns an indicator of where the specified point (px,py) lies with respect to the line segment from (x1,y1) to (x2,y2).
• ### Methods inherited from class java.lang.Object

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

• #### Lines

`public Lines()`
• ### Method Detail

• #### linesIntersect

```public static boolean linesIntersect(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
double x4,
double y4)```
Returns true if the specified two line segments intersect.
• #### lineIntersectsRect

```public static boolean lineIntersectsRect(double x1,
double y1,
double x2,
double y2,
double rx,
double ry,
double rw,
double rh)```
Returns true if the specified line segment intersects the specified rectangle.
• #### pointLineDistSq

```public static double pointLineDistSq(double px,
double py,
double x1,
double y1,
double x2,
double y2)```
Returns the square of the distance from the specified point to the specified line.
• #### pointLineDist

```public static double pointLineDist(double px,
double py,
double x1,
double y1,
double x2,
double y2)```
Returns the distance from the specified point to the specified line.
• #### pointSegDistSq

```public static double pointSegDistSq(double px,
double py,
double x1,
double y1,
double x2,
double y2)```
Returns the square of the distance between the specified point and the specified line segment.
• #### pointSegDist

```public static double pointSegDist(double px,
double py,
double x1,
double y1,
double x2,
double y2)```
Returns the distance between the specified point and the specified line segment.
• #### relativeCCW

```public static int relativeCCW(double px,
double py,
double x1,
double y1,
double x2,
double y2)```
Returns an indicator of where the specified point (px,py) lies with respect to the line segment from (x1,y1) to (x2,y2). See http://download.oracle.com/javase/6/docs/api/java/awt/geom/Line2D.html