pythagoras.i

## Class Points

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

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

All Methods
Modifier and Type Method and Description
`static int` ```distance(int x1, int y1, int x2, int y2)```
Returns the Euclidian distance between the specified two points, truncated to the nearest integer.
`static int` ```distanceSq(int x1, int y1, int x2, int y2)```
Returns the squared Euclidian distance between the specified two points.
`static int` ```manhattanDistance(int x1, int y1, int x2, int y2)```
Returns the Manhattan distance between the specified two points.
`static String` ```pointToString(int x, int y)```
Returns a string describing the supplied point, of the form `+x+y`, `+x-y`, `-x-y`, etc.
• ### Methods inherited from class java.lang.Object

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

• #### Points

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

• #### distanceSq

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

```public static int distance(int x1,
int y1,
int x2,
int y2)```
Returns the Euclidian distance between the specified two points, truncated to the nearest integer.
• #### manhattanDistance

```public static int manhattanDistance(int x1,
int y1,
int x2,
int y2)```
Returns the Manhattan distance between the specified two points.
• #### pointToString

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