I have four matlab vectors which denote the position of two airplanes using Shperical coordinates at different moments. I have calculated the distance between them using the haversine as
haversine_angle=(sin((phiMeanA-phiMeanB)/2)).^2+cos(lambdaMeanA).*cos(lambdaMeanB).*
(sin((lambdaMeanA-lambdaMeanB)/2)).^2;
haversine_sqrt=(haversine_angle).^0.5;
haversine_sqrt2=1.-haversine_sqrt;
RT=6378*1000;
haversine_mean_distance =RT.*atan2(haversine_sqrt, haversine_sqrt2);
I also have four aditional vectors which contain the values of the standard deviation associated to phiMeanA, phiMeanB, lambdaMeanA
and lambdaMeanB
, so, I would like to calculate the standard deviation of haversine_mean_distance
, but I don't know how to do it. Can someone point me in the right direction?
In the end I was able to do it using this propagation of uncertainty using phimeanA, phiMeanB, lambdameanA and lambdaMeanB as x, y, z and t.