gps fix
This commit is contained in:
parent
f94b3dc12c
commit
9dbd248cd3
|
@ -97,7 +97,7 @@ void gps_from_rb(double range, double bearing, double out[3]) {
|
|||
double lon = cur_pos[1]*M_PI/180.0;
|
||||
bearing = bearing*M_PI/180.0;
|
||||
out[0] = asin(sin(lat) * cos(range/EARTH_RADIUS) + cos(lat) * sin(range/EARTH_RADIUS) * cos(bearing));
|
||||
out[1] = lon + atan2(sin(bearing) * sin(range/EARTH_RADIUS) * cos(lat), cos(bearing/EARTH_RADIUS) - sin(lat)*sin(out[0]));
|
||||
out[1] = lon + atan2(sin(bearing) * sin(range/EARTH_RADIUS) * cos(lat), cos(range/EARTH_RADIUS) - sin(lat)*sin(out[0]));
|
||||
out[2] = height; //constant height.
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue