Reputation: 5227
I am puzzled by an error I get with gpu.js. I am trying to do GPU-based calculations of nearest point on line, as I have to process hundreds of points against a line with thousands of segments.
See in-progress code at https://codepen.io/simonecesano/pen/rNeVKee
I stumble on the issue that - at line 48 if I do this:
var ptos = geodistance(fx, fy, sx, sy);
return geodistance(fx, fy, sx, sy);
everything works but if I do this:
var ptos = geodistance(fx, fy, sx, sy);
return ptos;
I get Uncaught Error: Identifier is not defined
in gpu.browser.js
Why is that, and what do I have to do to fix it?
Upvotes: 1
Views: 443