rdococ wrote:
Converting x and y velocities to direction
It's simpler than that...
Use([asin v] of ((x vel) / (speed)))or([acos v] of ((y vel) / (speed)))That will work very well, provided that both values are not exactly equal to the speed all the time. If the direction was 45, and the speed was 5, then both x and y velocities must be 2.5.
No, It messes up in the "lower hemisphere". Which is what the if-else thing was for.
Offline
dividing by zero is impossible for computers because - lets say we had 120÷0, the answer for a human would be 0, because there's nothing to divide by. This is where calculators go bonkers and would make a recurring answer - like 3.666666 - but in this case it errors and makes massive lag (aka even nore slowness).
EDIT: Woah, woah, woah - how did I get the divide sign??
Last edited by DigiTechs (2012-03-11 18:50:15)
Offline