Rev 378 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 378 | Rev 385 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
29 | if (!x && !y) return 0; //atan2 = 0 für x und y = 0 |
Line 30... | Line 30... | ||
30 | 30 | ||
31 | if (y < 0) |
31 | if (y < 0) |
32 | { |
32 | { |
33 | m=-1; |
- | |
34 | y=abs(y); |
33 | m=-1; |
35 | } |
34 | } |
Line 36... | Line 35... | ||
36 | else m=1; |
35 | else m=1; |
Line 37... | Line 36... | ||
37 | 36 | ||
Line 38... | Line 37... | ||
38 | if (x==0) return (90*m); // atan2 = 90° für x = 0 |
37 | if (x==0) return (90*m); // atan2 = 90° für x = 0 |
39 | 38 | ||
40 | i = ((long)y*50) / abs(x); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
39 | i = abs(((long)y*50) / x); // Berechne i für die Lookup table (Schrittweite atan(x) ist 0.02 -> *50) |
41 | 40 |