A83: Calculating Distances Fast - any suggestions ?


[Prev][Next][Index][Thread]

A83: Calculating Distances Fast - any suggestions ?




Hi.

I'm working on a 3D vector graphics engine at the moment ; still not
sure what it'll be used for. It is a "fix" approximation, but a pretty good
one.

I wondered if anyone knew a fast decent approximation to the distance
calculation Sqrt(x^2+y^2). At present I'm using (|x|+|y|)/2 which is okay
when objects are roughly scattered, but tends to stuff up any straight
lines, drawing a boxed outline of objects this approximation morphs it
into a "star" shape. I don't really want to multiply if possible so
a couple of iterations of Newton-Rhapson are out.

Paul Robson.



Follow-Ups: