atari email archive

a collection of messages sent at Atari from 1983 to 1992.

approximations for sqrt(x*x+y*y)

(1 / 1)


	There is a better linear approximation for sqrt(x*x+y*y).  The
classic approximation of max + 3/8min has an error of -2.78 to 6.8%.
Using max + 1/4min + 3/8(min-1/2max)(if positive) the error is between
0 and 3.07%.

	For those of use using growth hardware, the classic approximation
will cause a 100 pixel high object to vary in size by 9 pixels over the
visible range.  The better approximation will reduce the size distortion
to 3 pixels.
Message 1 of 1

Oct 31, 1991