Point3D
A 3D point, used by the agent layer's volumetric projections (introduced in Phase 6 for UAV / drone modeling).
Mirrors Point2D in shape — same arithmetic operators, same magnitude / normalized() / distance helpers — extended to a third axis. The third coordinate is named z and conventionally represents altitude in drone models, but the type is geometry- agnostic: any 3D Cartesian context works.
Defined as a lightweight data class independent of KSL's existing ksl.modeling.spatial.LocationIfc hierarchy, matching the design decision in Point2D. Integration with a 3D spatial-layer model is deferred (see §13.5 of the agent-based- modeling design doc — the GPS / lat-lon use case is unsupported by this phase).
Equality note: as a data class, == uses Double.equals per component, which follows IEEE-754 corner cases — -0.0 is not equal to 0.0, and any point containing NaN is not equal to itself. For position comparisons prefer distanceTo with a tolerance.
Properties
Functions
Euclidean distance to other. Uses a numerically-stable form that avoids overflow for very large coordinates: factor out the largest absolute component, then take the root of the sum of squared ratios.
Unit vector in the same direction as this point (treated as a vector from the origin). Returns the origin if this point is the origin (no canonical direction).
Squared Euclidean distance to other. Faster than distanceTo when only comparison is needed (no square root).