coordinate bug cleanup

This commit is contained in:
2026-05-03 09:23:21 -07:00
parent 81fe1b67c5
commit 4159a3a5cb
4 changed files with 22 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
function obj = clearRssCache(obj)
arguments (Input)
obj (1, 1) {mustBeA(obj, "rfSensor")};
end
arguments (Output)
obj (1, 1) {mustBeA(obj, "rfSensor")};
end
obj.rssCache = double.empty(0, 1);
end
+1
View File
@@ -24,6 +24,7 @@ classdef rfSensor
[d, t, a] = computePointToPoints(obj, agentPos, targetPos);
[f] = plotParameters(obj); % debug, plot sensor response as a function of distance and tilt angle
[f] = plotPerformance(obj, altitude, otherSensorsPos, otherSensors); % debug, plot SNR or SINR ground heatmap for a given geometry
obj = clearRssCache(obj);
end
methods (Access = private)
x = RSS(obj, d, t, a); % Received signal strength (function of distance and tilt angle)
+1 -1
View File
@@ -15,7 +15,7 @@ function value = transmitterGain(obj, t, a)
% Angular offset from boresight via spherical law of cosines
% Convention: t=0° nadir, t=90° horizon; a=0° +y, a=90° +x
cos_theta = sind(obj.tilt) .* sind(t) .* cosd(a - obj.tilt) + ...
cos_theta = sind(obj.tilt) .* sind(t) .* cosd(a - obj.azimuth) + ...
cosd(obj.tilt) .* cosd(t);
cos_theta = max(-1, min(1, cos_theta)); % clamp for numerical safety
theta = acosd(cos_theta);