function t = minabs(zv)
% t = minabs([zm1,z0,z1])
% for complex numbers zm1, z0, z1 consider piecewise linear interpolating curve 
% p(t) with p(-1)=zm1, p(0)=z0, p(1)=z1
% find t in interval [-1,1] such that |p(t)| is minimal

wv = diff(zv);                  % vector of differences
tv = -real(zv(1:end-1).*conj(wv))./abs(wv).^2;
tv = min(max(tv,0),1);
d = abs(zv(1:2) + tv.*wv);      % d = [abs(p1),abs(p2)]
[m,j] = min(d);
t = tv(j) + j - 2;

