Fwd: no Point2D.setLocation(x,y)?

Jeff Hain jeffhain at rocketmail.com
Sat Aug 1 17:38:48 UTC 2015


>Math.sqrt(a * a + b * b) could be replaced with Math.hypot(a,b)
hypot is typically much slower than the "naive" computation.
Instead of trying to make all the code handle huge or tiny valuesas well as it could, which would make it complicated, slow and brittle,and would not necessarily make sense for graphic stuffs (x * x overflowsnear x = 1e154ish, which should be well out of the frustum),
what can be done is checking that values are "reasonable" whenthey enter the program, and that the program doesn't generateproblematic values by itself from reasonable ones.
-Jeff
 


More information about the openjfx-dev mailing list