pythagoras.f

## 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(float x1, float y1, float x2, float y2, float rx, float ry, float rw, float rh)```
Returns true if the specified line segment intersects the specified rectangle.
`static boolean` ```linesIntersect(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)```
Returns true if the specified two line segments intersect.
`static float` ```pointLineDist(float px, float py, float x1, float y1, float x2, float y2)```
Returns the distance from the specified point to the specified line.
`static float` ```pointLineDistSq(float px, float py, float x1, float y1, float x2, float y2)```
Returns the square of the distance from the specified point to the specified line.
`static float` ```pointSegDist(float px, float py, float x1, float y1, float x2, float y2)```
Returns the distance between the specified point and the specified line segment.
`static float` ```pointSegDistSq(float px, float py, float x1, float y1, float x2, float y2)```
Returns the square of the distance between the specified point and the specified line segment.
`static int` ```relativeCCW(float px, float py, float x1, float y1, float x2, float 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(float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4)```
Returns true if the specified two line segments intersect.
• #### lineIntersectsRect

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

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

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

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

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

```public static int relativeCCW(float px,
float py,
float x1,
float y1,
float x2,
float 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