Wrap Module
Functions and values
| Function or value |
Description
|
Full Usage:
wrapDeltaX worldWidth fromX toX
Parameters:
float
fromX : float
toX : float
Returns: float
|
Shortest wrap-aware delta from `fromX` to `toX` on a toroidal axis of width `worldWidth` (> 0). Result is the signed distance of least magnitude in (-worldWidth/2, worldWidth/2]. Pure and deterministic; identity `wrapDeltaX w a a = 0`; e.g. `wrapDeltaX 100 90 10 = 20`, `wrapDeltaX 100 10 90 = -20`.
|