pythagoras.d

## Class Points

• ```public class Points
extends Object```
Point-related utility methods.
• ### Field Summary

Fields
Modifier and Type Field and Description
`static IPoint` `ZERO`
The point at the origin.
• ### Constructor Summary

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

All Methods
Modifier and Type Method and Description
`static double` ```distance(double x1, double y1, double x2, double y2)```
Returns the Euclidean distance between the specified two points.
`static double` ```distanceSq(double x1, double y1, double x2, double y2)```
Returns the squared Euclidean distance between the specified two points.
`static boolean` ```epsilonEquals(IPoint p1, IPoint p2)```
Returns true if the supplied points' x and y components are equal to one another within `MathUtil.EPSILON`.
`static boolean` ```epsilonEquals(IPoint p1, IPoint p2, double epsilon)```
Returns true if the supplied points' x and y components are equal to one another within `epsilon`.
`static Point` ```inverseTransform(double x, double y, double sx, double sy, double rotation, double tx, double ty, Point result)```
Inverse transforms a point as specified, storing the result in the point provided.
`static String` ```pointToString(double x, double y)```
Returns a string describing the supplied point, of the form `+x+y`, `+x-y`, `-x-y`, etc.
`static Point` ```transform(double x, double y, double sx, double sy, double sina, double cosa, double tx, double ty, Point result)```
Transforms a point as specified, storing the result in the point provided.
`static Point` ```transform(double x, double y, double sx, double sy, double rotation, double tx, double ty, Point result)```
Transforms a point as specified, storing the result in the point provided.
• ### Methods inherited from class java.lang.Object

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

• #### ZERO

`public static final IPoint ZERO`
The point at the origin.
• ### Constructor Detail

• #### Points

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

• #### distanceSq

```public static double distanceSq(double x1,
double y1,
double x2,
double y2)```
Returns the squared Euclidean distance between the specified two points.
• #### distance

```public static double distance(double x1,
double y1,
double x2,
double y2)```
Returns the Euclidean distance between the specified two points.
• #### epsilonEquals

```public static boolean epsilonEquals(IPoint p1,
IPoint p2)```
Returns true if the supplied points' x and y components are equal to one another within `MathUtil.EPSILON`.
• #### epsilonEquals

```public static boolean epsilonEquals(IPoint p1,
IPoint p2,
double epsilon)```
Returns true if the supplied points' x and y components are equal to one another within `epsilon`.
• #### transform

```public static Point transform(double x,
double y,
double sx,
double sy,
double rotation,
double tx,
double ty,
Point result)```
Transforms a point as specified, storing the result in the point provided.
Returns:
a reference to the result point, for chaining.
• #### transform

```public static Point transform(double x,
double y,
double sx,
double sy,
double sina,
double cosa,
double tx,
double ty,
Point result)```
Transforms a point as specified, storing the result in the point provided.
Returns:
a reference to the result point, for chaining.
• #### inverseTransform

```public static Point inverseTransform(double x,
double y,
double sx,
double sy,
double rotation,
double tx,
double ty,
Point result)```
Inverse transforms a point as specified, storing the result in the point provided.
Returns:
a reference to the result point, for chaining.
• #### pointToString

```public static String pointToString(double x,
double y)```
Returns a string describing the supplied point, of the form `+x+y`, `+x-y`, `-x-y`, etc.