2.18.3
Bug-fix release: correct Math.atan2 results on the GPU.
Fixed
Math.atan2(y, x)returned wrong quadrants on GPU backends (#647). The GLSL implementation used single-argumentatan(y / x), which collapses the result into (-π/2, π/2) and is undefined at x = 0; it now uses two-argumentatan(y, x)with explicit x = 0 handling, matching JavaScript'sMath.atan2across the full (-π, π] range. Thanks @ted-piotrowski for the fix (#683, merged at last).
Installing
npm install gpu.js@2.18.3<script src="https://unpkg.com/gpu.js@2.18.3/dist/gpu-browser.min.js"></script>