Subj : Re: Rational Trig To : comp.programming From : DarkD Date : Mon Sep 19 2005 07:28 pm "William" wrote in message news:ca6dnUxytvyGBrDeRVn-3Q@giganews.com... > "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.) > > 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 I have tried it in a few line detection algorithms I have and you can do alot of stuff like trangulation without any square roots look up tables etc etc and even without division if you factor big enough. .