To make it easier, you could use a lookup table. Here is an example of one for the memsic for a basic stamp. http://www.parallax.com/Portals/0/Do...3/col/nv92.pdf .The table lookups only calculate on one axis, so they will not be as accurate as a 3 axis solution, but might be perfectly fine for your application.
Bookmarks