Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!zs04+ From: zs04+@andrew.cmu.edu (Zachary T. Smith) Newsgroups: comp.graphics Subject: Re: APPROXIMATING SQUARE_ROOT Message-ID: Date: 18 Nov 89 17:53:52 GMT References: <1989Oct26.155201.5087@rpi.edu> <14397@well.UUCP> <8603@microsoft.UUCP>, <6332@portia.Stanford.EDU> Distribution: usa Organization: Carnegie Mellon, Pittsburgh, PA Lines: 14 In-Reply-To: <6332@portia.Stanford.EDU> I realize this is an old discussion, but nobody seems to have considered this solution, so... Assuming you're using integer math (and tho I'm only a novice regarding computer graphics, I do at least know that the simple stuff like 3d rotation can be done with integer math), I would strongly suggest you use a lookup table. If your numbers are 16 bits wide, that's easy enuf to do since 64k by 16 isn't much memory. If your number is 32 bits, use the same 64k by 16 table but do it in 2 stages-- do a lookup for the upper 16 bits, then divide its root out twice and do a lookup for the remaining value. -Zach T. Smith (zs04+@andrew.cmu.edu)