Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 383 → Rev 384

/branches/v0.60_MicroMag3_Nick666/math.c
31,7 → 31,7
if (x==0) return (90*m); // atan2 = 90° für x = 0
i = abs(((float)y / x) * 50); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50)
i = abs(((long)y*100 / x) / 2); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50)
 
if (i<270) angle = pgm_read_byte(&pgm_atan[i]); // Lookup für 1° bis 79°
else if (i>5750) angle = 90; // Grenzwert ist 90°