public class Point<NUMBER extends AbstractNumber = Double> extends Object:
Represents a two-dimensional point.
A point stores an absolute location while Vector represents a displacement.
Example:
p = Point<Double>(10.0, 20.0) moved = p + Vector<Double>(5.0, -2.0)
| Modifier and Type | Member | Description |
|---|---|---|
| public property | xx as NUMBER |
Horizontal coordinate. |
| public propert | yy y as NUMBER |
Vertical coordinate. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | PointPoint(x as NUMBER = 0, y as NUMBER = 0): |
Creates a point from its coordinates. |
| Modifier and Type | Member | Description |
|---|---|---|
| public method | distanceTo | Computes the Euclidean distance to another point. |
| public override | toStringtoString() as String: |
Returns a readable representation of the point. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | operator+(vect as Vector<NUMBER>) as Point<NUMBER>: | Returns a translated point. |
| public | operator+=(vect as Vector<NUMBER>) as Void: | Translates this point in place. |
| public | operator-(vect as Vector<NUMBER>) as Point<NUMBER>: | Returns a point translated in the opposite direction. |
| public | operator-=(vect as Vector<NUMBER>) as Void: | Translates this point in place in the opposite direction. |