Browse Source

드론 utils 헤딩방향 계산식 수정

pull/1/head
junh_eee(이준희) 9 months ago
parent
commit
53d56fd054
  1. 7
      test/pav-utils.js

7
test/pav-utils.js

@ -74,9 +74,10 @@ function calculateHeading(x1, y1, x2, y2) {
var dx = x2 - x1;
var dy = y2 - y1;
var heading = (Math.atan2(dy, dx) * 180) / Math.PI;
if (heading < 0) {
heading += 360;
}
// Ensure heading is within the range [0, 360)
heading = (heading + 360) % 360;
return heading;
}

Loading…
Cancel
Save