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

Sam Howman s.howman.4580 at gmail.com
Thu Jul 30 03:27:39 UTC 2015


Some other comments about this class (and Point3D):
* In calculating the magnitude (and distance): Math.sqrt(a * a + b * b)
could be replaced with Math.hypot(a,b) to get the advantage of avoiding
intermediate underflow and overflow
* distanceSquared functions are faster for doing comparisons of distances
(avoid two square roots).
* Adding a method crossProductMagnitude would allow the angle compuations
to be done with a single line:

Math.atan2(crossProductMagnitude(A,B), dotProduct(A,B));

Is it possible/likely that at the workings of such a class be ammended
in these ways? Who decides?


More information about the openjfx-dev mailing list