RF antenna azimuth, plotting improvements

This commit is contained in:
2026-04-26 10:28:28 -07:00
parent 6cb6dabcb5
commit d07df25528
13 changed files with 88 additions and 65 deletions
+5 -2
View File
@@ -1,4 +1,4 @@
function [d, t] = computePointToPoints(obj, agentPos, targetPos)
function [d, t, a] = computePointToPoints(obj, agentPos, targetPos)
arguments (Input)
obj (1, 1) {mustBeA(obj, "rfSensor")};
agentPos (1, 3) double;
@@ -7,6 +7,7 @@ function [d, t] = computePointToPoints(obj, agentPos, targetPos)
arguments (Output)
d (:, 1) double;
t (:, 1) double;
a (:, 1) double;
end
% distance from sensor to target
@@ -15,7 +16,9 @@ function [d, t] = computePointToPoints(obj, agentPos, targetPos)
% distance from sensor nadir to target nadir (i.e. distance ignoring altitude)
x = vecnorm(agentPos(1:2) - targetPos(:, 1:2), 2, 2);
% tilt angle (degrees)
% tilt angle (degrees) (-90, 0 (down), 90)
t = (180 - atan2d(x, targetPos(:, 3) - agentPos(3)));
% azimuth angle (degrees) (0 (+y) clockwise to 360)
a = mod(atan2d(targetPos(:,1) - agentPos(1), targetPos(:,2) - agentPos(2)), 360);
end