1. Maths Shortcuts

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

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu