Skip to main content

Module geometry

Module geometry 

Source
Expand description

Integer/float conventions shared with the adapter. JavaScript’s Math.round rounds halves toward +∞ and Math.floor(x + .5) does not (it fails just below a half), so the exact form is spelled out.

Structs§

Rect
Rng
Xorshift32 with the exact | 0 / >>> 0 semantics of src/core/math.ts::rng.

Functions§

js_ceil
js_floor
js_hypot
Math.hypot(x, y) as V8 and JavaScriptCore compute it: scale by the larger magnitude, Kahan-sum the squares, multiply back. Not the correctly rounded libm hypot; poses compared against dmin and sorted by distance must round exactly as the historical adapter did.
js_round
Math.round: nearest integer, halves toward +∞.