function [Glidex] = calcDistanceSpraySpray(Glidex,s,prof)
%CALCDISTANCESPRAYBOG Calculate distance between Spray profile and past
%Spray Profiles

indexLat = Glidex.latitude;
indexLon = Glidex.longitude;

% Define the target coordinates
SprayLat = s.lat(prof); % target latitude
SprayLon = s.lon(prof); % target longitude
wgs84 = wgs84Ellipsoid("m");
Glidex.distance2spray = distance(indexLat,indexLon,SprayLat,SprayLon,wgs84) / 1000; % km

end