pythagoras.d

## Class Point

• ### Field Summary

Fields
Modifier and Type Field and Description
`double` `x`
The x-coordinate of the point.
`double` `y`
The y-coordinate of the point.
• ### Constructor Summary

Constructors
Constructor and Description
`Point()`
Constructs a point at (0, 0).
```Point(double x, double y)```
Constructs a point at the specified coordinates.
`Point(XY p)`
Constructs a point with coordinates equal to the supplied point.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Point` ```addLocal(double dx, double dy)```
Translates this point by the specified offset.
`Point` `multLocal(double s)`
Multiplies this point by a scale factor.
`Point` `rotateLocal(double angle)`
Rotates this point in-place by the specified angle.
`Point` ```set(double x, double y)```
Sets the coordinates of this point to the supplied values.
`Point` `set(XY p)`
Sets the coordinates of this point to be equal to those of the supplied point.
`Point` ```subtractLocal(double x, double y)```
Subtracts the supplied x/y from this point.
`double` `x()`
The x coordinate.
`double` `y()`
The y coordinate.
• ### Methods inherited from class pythagoras.d.AbstractPoint

`add, add, add, clone, direction, distance, distance, distanceSq, distanceSq, equals, hashCode, mult, mult, rotate, rotate, subtract, subtract, subtract, toString`
• ### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`
• ### Field Detail

• #### x

`public double x`
The x-coordinate of the point.
• #### y

`public double y`
The y-coordinate of the point.
• ### Constructor Detail

• #### Point

`public Point()`
Constructs a point at (0, 0).
• #### Point

```public Point(double x,
double y)```
Constructs a point at the specified coordinates.
• #### Point

`public Point(XY p)`
Constructs a point with coordinates equal to the supplied point.
• ### Method Detail

• #### set

`public Point set(XY p)`
Sets the coordinates of this point to be equal to those of the supplied point.
Returns:
a reference to this this, for chaining.
• #### set

```public Point set(double x,
double y)```
Sets the coordinates of this point to the supplied values.
Returns:
a reference to this this, for chaining.
• #### multLocal

`public Point multLocal(double s)`
Multiplies this point by a scale factor.
Returns:
a a reference to this point, for chaining.

```public Point addLocal(double dx,
double dy)```
Translates this point by the specified offset.
Returns:
a reference to this point, for chaining.
• #### rotateLocal

`public Point rotateLocal(double angle)`
Rotates this point in-place by the specified angle.
Returns:
a reference to this point, for chaining.
• #### subtractLocal

```public Point subtractLocal(double x,
double y)```
Subtracts the supplied x/y from this point.
Returns:
a reference to this point, for chaining.
• #### x

`public double x()`
Description copied from interface: `XY`
The x coordinate.
Specified by:
`x` in interface `XY`
• #### y

`public double y()`
Description copied from interface: `XY`
The y coordinate.
Specified by:
`y` in interface `XY`