function f = f(M,X)
f = ones(size(M,1),1);
for i = 1:size(M,1)
    dx = (X(1)-M(i,1))^2;
    dy = (X(2)-M(i,2))^2;
    dz = (X(3)-M(i,3))^2;
    dt = 299792.458*(M(i,4)-X(4));
    f(i) = sqrt(dx + dy + dz) - dt;
end