Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: shade@dragonshadow.com (Scott Cartier) Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: What do'you mean I have to brush up on me maths! Date: Mon, 12 Jul 1999 16:53:50 GMT Organization: SCEA News Server Lines: 26 Message-ID: <378a1a59.1200158692@news.scea.sony.com> References: <7ko1jf$33u25@chuka.playstation.co.uk> <376fbd21.251404588@news.scea.sony.com> <7lkucs$ko217@chuka.playstation.co.uk> <7lnteg$i9a1@chuka.playstation.co.uk> <37823145.682258342@news.scea.sony.com> <7mah71$t1v6@chuka.playstation.co.uk> NNTP-Posting-Host: vmlabs66.vmlabs.com X-Newsreader: Forte Free Agent 1.11/32.235 >p.s. Scott - did you find out which method (sqrt or inv_tan) was faster? Nope, I haven't tried that experiment. >Oh and why can't you just use a simple look-up table for inv_tan? The problem is that the result of (dy / dx) can be any real number. SIN and COS are nice because you know the angle will be from 0-359 degrees and can make a look-up table of the appropriate size. Have an angle of 248 degrees? Simply look up array element 248 to get the SIN & COS. INV_TAN is harder because the value you would use as the index is the result of (dy / dx). This can be any real number from negative infinity to positive infinity. How do you make a finite-sized look-up table for such a thing? Compounding the problem is that the result isn't linearly proportional to the input. Or, inv_tan(1) is not merely 2 times inv_tan(0.5). That said, I'm sure there's a way (there always is), but I leave that for the smarter folks. :) Scott