[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Fwd: no Point2D.setLocation(x,y)?
From:       Sam Howman <s.howman.4580 () gmail ! com>
Date:       2015-07-30 3:27:39
Message-ID: CABU7dshv_WB6RcbmocKLygfrLWHSkJS26nHUEWDxVpTeQUz7JQ () mail ! gmail ! com
[Download RAW message or body]

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?
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic