diff --git a/src/buzzuav_closures.cpp b/src/buzzuav_closures.cpp index 6a2d64f..96fbae2 100644 --- a/src/buzzuav_closures.cpp +++ b/src/buzzuav_closures.cpp @@ -97,7 +97,9 @@ 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[0] = out[0]*180.0/M_PI; out[1] = lon + atan2(sin(bearing) * sin(range/EARTH_RADIUS) * cos(lat), cos(range/EARTH_RADIUS) - sin(lat)*sin(out[0])); + out[1] = out[1]*180.0/M_PI; out[2] = height; //constant height. } diff --git a/src/test1.bzz b/src/test1.bzz index d15a7fa..d6a5bcc 100644 --- a/src/test1.bzz +++ b/src/test1.bzz @@ -12,7 +12,7 @@ function updated_neigh(){ neighbors.broadcast(updated, update_no) } -TARGET_ALTITUDE = 10.01 +TARGET_ALTITUDE = 10.0 # Lennard-Jones parameters TARGET = 50.0 #0.000001001