View Single Post
  #28   Spotlight this post!  
Unread 15-07-2011, 15:24
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Cartesian to angle

Quote:
Originally Posted by jhersh View Post
Floating point operations ... are done in the PPC core's FPU. You can look at the details for it here: http://cache.freescale.com/files/32b...e300coreRM.pdf

Edit: FP instructions are in section 3.2.4.2 (pg 119).
Thanks for the link Joe.

Using two fmadds instructions1, at one cycle each2, you can get arctangent(x) in the first octant accurate to +/- 0.25 degrees. Pretty tough to beat with a lookup table.

Wrap 3 compares, 1 divide, and 1 more add around that, and you've got atan2(y,x) accurate to +/- 0.25 degrees good for all four quadrants.



1Para 3.2.4.2.2 Table 3-9

2Para 1.1