1. Maths Shortcuts
- Posted by Lmailles at AOL.COM
Jul 03, 1998
Someone (Irv or Jiri I think) mentioned a while back that a lot of maths ops
can be shortcutted - specifically square roots and arctans.
I want to do a distance calculation, in both 2d and 3d, and am currently using
pythagorus' standard rule :
dis = sqrt( (x2-x1)^2 + (y2-y1)^2)
dis3d = sqrt( (x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2)
(^ operator used for simplicity)
Is there a reasonable shortcut here ?
For my current usage I only need an approximation - accuracy to 1dp would be
absolutely fine.
TIA
@@@
\ | /
\|/
"Our greatest failure in life is our inability to achieve an objective view of
reality" -Les Mailles
Daniel