function Fvector = GPSfunction(Xvector,DATA)
% Xvector=[x; y; z; t]
% DATA = [x1 x2 x3 x4; y1 y2 y3 y4; z1 z2 z3 z4; d1 d2 d3 d4];
% where di is the apparent elapse time of signal.
% Distance is in meters.
% Time is in nanoseconds.
% K. Ming Leung, 02/07/04

c2 = 0.299792458^2;
DX = repmat(Xvector,1,4) - DATA;
Fvector = (sum(DX(1:(end-1),1:end).^2,1) - c2*(DX(end,:).^2))';
