function [x0,u] = track_fit_linear3(t, x1, x2, x3)
	%	[x0,u]	= track_fit_linear3(t, x1, x2, x3)
	% 
	% for a set of particle coordinates (x1,x2,x3) representing the
	% trajectories of N particles at three time instants t(1), t(2), t(3)
	% find the least-squares linear model
	%	x = x0 + u*t
	% which best fits the data
	
	%% sanity check
	n_part			= size(x1,2);
	assert(size(x2,2) == n_part, 'particle position must be consistent size');
	assert(size(x3,2) == n_part, 'particle position must be consistent size');
	assert(size(x1,1) == 3, 'x1 must be 3xN array');
	assert(size(x2,1) == 3, 'x2 must be 3xN array');
	assert(size(x3,1) == 3, 'x3 must be 3xN array');
	
	%% do linear least squares fit
	X				= [eye(3) t(1)*eye(3); eye(3) t(2)*eye(3); eye(3) t(3)*eye(3)];
	x0u_best_fit	= pinv(X) * [x1; x2; x3];
	x0				= x0u_best_fit(1:3, :);
	u				= x0u_best_fit(4:6, :);
end