[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

**To**:**"Robert Fritzsche" <robert.fritzsche%googlemail.com@localhost>****Subject**:**Re: atan2 and sqrt --> in driver****From**:**"Andy Shevchenko" <andy.shevchenko%gmail.com@localhost>**- Date: Tue, 9 Dec 2008 21:22:08 +0200

On Tue, Dec 9, 2008 at 7:01 PM, Robert Fritzsche <robert.fritzsche%googlemail.com@localhost> wrote: > The driver is for the wii-remote, so get 1 byte for x-, y- and z-axis. > Based on this values I will calculate the pitch = atan2(y, > sqrt(x^2+z^2)) and yaw = atan2(z, sqrt(x^2+y^2)) You could use approx evaluations. Set tables with some 32bit predefined values (hint: you can use 32 bit value as float with integer and fraction parts). Actually, to calculate sqrt you need the precalculated the n^2, for n = 2, ..., 99, ... Just found one link in Google http://www.homeschoolmath.net/teaching/square-root-algorithm.php -- With Best Regards, Andy Shevchenko

**References**:**atan2 and sqrt --> in driver***From:*Robert Fritzsche

**Re: atan2 and sqrt --> in driver***From:*Ignatios Souvatzis

**Re: atan2 and sqrt --> in driver***From:*Robert Fritzsche

- Prev by Date:
**Re: Proposal: B_ARRIER (addresses wapbl performance?)** - Next by Date:
**Re: atan2 and sqrt --> in driver** - Previous by Thread:
**Re: atan2 and sqrt --> in driver** - Next by Thread:
**Re: atan2 and sqrt --> in driver** - Indexes: