subr errors,xp,yp,x,y,mag,ang
 ;uses mag and ang and the first set of points to compute position errors
 ;get the reference points, note that xp,yp are for master (fixed) image
 ;and we compute where these would end up in second image and compare
 ;with actual second image positions
 xr=first_elem(xp)
 yr=first_elem(yp)
 xq=xp-xr		yq=yp-yr
 ;rotate first, in direction opposite ang
 theta=-ang*#d.r
 save=xq
 xq=xq*cos(theta)-yq*sin(theta)
 yq=save*sin(theta)+yq*cos(theta)
 ;now stretch by recip. of magx and magy
 xq=xq/mag	yq=yq/mag
 xr=first_elem(x)
 yr=first_elem(y)
 ;now just add in ref. point of second image
 xq=xq+xr	yq=yq+yr
 ty,'x errors', xq-x
 ty,'y errors', yq-y
 endsubr
 ;===========================================================================
