Subj : Re: Rational Trig To : comp.programming From : Gerry Quinn Date : Mon Sep 19 2005 12:28 pm In article , Reply@NewsGroup.Please says... > "Gerry Quinn" wrote in message > news:MPG.1d97564247ecb7fc98a5b2@news.indigo.ie... > > > > I am unconvinced that recursion and look-up tables are to be avoided > > simply by replacing distances by their squares, and angles by the > > squares of their sins. Aren't we going to need them to get from > > quadratures to distances, in any case? Distances are not going to go > > away as a commonly desired result from calculations. > > But not always, and if this helps people see that, it could be > very useful. > > In fact, just a few days ago someone was asking about efficient > ways to find the closest points between two arrays of 3D points. > A number of proposed solutions involved square roots when > there is no reason to take a square root at all. (Squared > distances compare just as easily as the distances themselves.) True, but anyone who ever wrote a computer game is already wise to that trick! > Likewise, I've optimised a number of algorithms by using ratios > instead of angles. And line slope IS a ratio - no reason to > complete the division if you can work with the components > directly. -Wm Whatever the format, it should simplify to the same equations in principle. (Of course this does not always happen in practice.) - Gerry Quinn .