Subversion Repositories FlightCtrl

Rev

Rev 179 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 179 Rev 180
Line 14... Line 14...
14
 
14
 
Line 15... Line 15...
15
const unsigned int pgm_sinus[91] PROGMEM = {0,17,35,52,70,87,105,122,139,156,174,191,208,225,242,259,276,292,309,326,342,358,375,391,407,423,438,454,469,485,500,515,530,545,559,574,588,602,616,629,643,656,669,682,695,707,719,731,743,755,766,777,788,799,809,819,829,839,848,857,866,875,883,891,899,906,914,921,927,934,940,946,951,956,961,966,970,974,978,982,985,988,990,993,995,996,998,999,999,1000,1000};
15
const unsigned int pgm_sinus[91] PROGMEM = {0,17,35,52,70,87,105,122,139,156,174,191,208,225,242,259,276,292,309,326,342,358,375,391,407,423,438,454,469,485,500,515,530,545,559,574,588,602,616,629,643,656,669,682,695,707,719,731,743,755,766,777,788,799,809,819,829,839,848,857,866,875,883,891,899,906,914,921,927,934,940,946,951,956,961,966,970,974,978,982,985,988,990,993,995,996,998,999,999,1000,1000};
16
 
16
 
17
 
17
 
18
//-----------------------------------------------
18
//-----------------------------------------------
19
// Fast arctan2
19
// Fast arctan2 with max error of .01 rads
20
// http://www.dspguru.com/comp.dsp/tricks/alg/fxdatan2.htm
20
// http://www.dspguru.com/comp.dsp/tricks/alg/fxdatan2.htm
21
//-----------------------------------------------
21
//-----------------------------------------------
Line 31... Line 31...
31
   {
31
   {
32
      y = abs(y);
32
      y = abs(y);
33
      m = -1;                   // neg. für Quadrant III + IV
33
      m = -1;                   // neg. für Quadrant III + IV
34
   }
34
   }
35
   else m = 1;
35
   else m = 1;
36
       
-
 
Line 37... Line 36...
37
   
36
   
38
   if (x>=0)
37
   if (x>=0)
39
   {
38
   {
40
      r = (x - y) / (x + y);
39
      r = (x - y) / (x + y);