pythagoras.i

## Interface IPoint

• ### Method Summary

All Methods
Modifier and Type Method and Description
`Point` ```add(int x, int y)```
Translates this point by the specified offset.
`Point` ```add(int x, int y, Point result)```
Translates this point by the specified offset and stores the result in the object provided.
`Point` `clone()`
Returns a mutable copy of this point.
`int` ```distance(int px, int py)```
Returns the Euclidian distance between this point and the specified point.
`int` `distance(IPoint p)`
Returns the Euclidian distance between this point and the supplied point.
`int` ```distanceSq(int px, int py)```
Returns the squared Euclidian distance between this point and the specified point.
`int` `distanceSq(IPoint p)`
Returns the squared Euclidian distance between this point and the supplied point.
`Point` ```subtract(int x, int y)```
Subtracts the supplied point from `this`.
`Point` ```subtract(int x, int y, Point result)```
Subtracts the supplied point from `this` and stores the result in `result`.
`Point` ```subtract(IPoint other, Point result)```
Subtracts the supplied point from `this` and stores the result in `result`.
`int` `x()`
Returns this point's x-coordinate.
`int` `y()`
Returns this point's y-coordinate.
• ### Method Detail

• #### x

`int x()`
Returns this point's x-coordinate.
• #### y

`int y()`
Returns this point's y-coordinate.
• #### distanceSq

```int distanceSq(int px,
int py)```
Returns the squared Euclidian distance between this point and the specified point.
• #### distanceSq

`int distanceSq(IPoint p)`
Returns the squared Euclidian distance between this point and the supplied point.
• #### distance

```int distance(int px,
int py)```
Returns the Euclidian distance between this point and the specified point.
• #### distance

`int distance(IPoint p)`
Returns the Euclidian distance between this point and the supplied point.

```Point add(int x,
int y)```
Translates this point by the specified offset.
Returns:
a new point containing the result.

```Point add(int x,
int y,
Point result)```
Translates this point by the specified offset and stores the result in the object provided.
Returns:
a reference to the result, for chaining.
• #### subtract

```Point subtract(int x,
int y)```
Subtracts the supplied point from `this`.
Returns:
a new point containing the result.
• #### subtract

```Point subtract(int x,
int y,
Point result)```
Subtracts the supplied point from `this` and stores the result in `result`.
Returns:
a reference to the result, for chaining.
• #### subtract

```Point subtract(IPoint other,
Point result)```
Subtracts the supplied point from `this` and stores the result in `result`.
Returns:
a reference to the result, for chaining.
• #### clone

`Point clone()`
Returns a mutable copy of this point.