Skip to content

2.18.3

Choose a tag to compare

@fuzzie360 fuzzie360 released this 22 Jul 13:03

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-argument atan(y / x), which collapses the result into (-π/2, π/2) and is undefined at x = 0; it now uses two-argument atan(y, x) with explicit x = 0 handling, matching JavaScript's Math.atan2 across 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>