/branches/v0.60_MicroMag3_Nick666/trunc/math.c |
---|
31,13 → 31,12 |
if (y < 0) |
{ |
m=-1; |
y=abs(y); |
} |
else m=1; |
if (x==0) return (90*m); // atan2 = 90° für x = 0 |
i = ((long)y*50) / abs(x); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
i = abs(((long)y*50) / x); // 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° |