public class Point3d<NUMBER extends AbstractNumber = Double>
Three-dimensional position, distinct from a displacement (Vector3d). Coordinates retain their numeric type; distances are computed as Double.
import klyn.math.geometry position = Point3d<Double>(1.0, 2.0, 3.0) moved = position + Vector3d<Double>(4.0, 0.0, -1.0) assert moved.z == 2.0
| Modifier and Type | Member | Description |
|---|---|---|
| public property | xx as NUMBER |
X coordinate. |
| public propert | yy y as NUMBER |
Y coordinate. |
| public property | zz as NUMBER |
Z coordinate. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Point3dPoint3d(x as NUMBER = 0, y as NUMBER = 0, z as NUMBER = 0) |
Creates a position, defaulting to the origin. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | distanceTo | Computes the Euclidean distance using scaled hypot operations. |
| public override | toStringtoString() as String |
Returns coordinates in Point3d(x, y, z) form. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | operator+(notnull displacement as Vector3d<NUMBER>) as Point3d<NUMBER> | Translates this position without modifying it. |
| public | operator+=(notnull displacement as Vector3d<NUMBER>) as Void | Applies a translation in place. |
| public | operator-(notnull displacement as Vector3d<NUMBER>) as Point3d<NUMBER> | Translates this position in the opposite direction without modifying it. |
| public | operator-=(notnull displacement as Vector3d<NUMBER>) as Void | Applies the opposite translation in place. |