function j = jacobian(M,X)
j = ones(size(M,1),4);
c = 299792.458;
for i = 1:size(M,1)
    sq = sqrt((X(1)-M(i,1))^2 + (X(2)-M(i,2))^2 + (X(3)-M(i,3))^2);
    j(i,1) = (X(1)-M(i,1))/(sq);
    j(i,2) = (X(2)-M(i,2))/(sq);
    j(i,3) = (X(3)-M(i,3))/(sq);
    j(i,4) = c;
end