Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 265 → Rev 266

/branches/salvo_gps/math.c
42,7 → 42,7
 
// Wert durch lineare Interpolation ermitteln
if ((y == 0) && (x == 0)) wert =1; // Division durch 0 nicht erlaubt
else wert= abs(((long) x*1000)/((long)y));
else wert= abs(((long)x*1000)/((long)y));
 
if (wert <=268) //0...0.0,268 entsprechend 0..15 Grad
{
108,7 → 108,7
}
 
// Aus x,y und Winkel Distanz ermitteln
int get_dist(signed int x, signed int y, signed int phi)
long get_dist(signed int x, signed int y, signed int phi)
{
long dist;
if (abs(x) > abs(y) )
121,6 → 121,6
dist = (long) y;
dist = abs((dist *1000) / (long) cos_i(phi));
}
return (int)dist;
return dist;
}