function xyW=lwm_forward(Tr,xy)
%for forward transformation of points

xl=xy(:,1);
yl=xy(:,2);

%for each point to transform
for i=1:size(xl,1)

%find closest control point
d=distance(Tr.tdata.ControlPoints,[xl(i), yl(i)]);
[controlpt,indx]=min(d);%indx = control point number to use
[xyW(i,1:2)] = trans2nd(Tr.tdata.LWMTData(:,:,indx),[xl(i) yl(i)]);
%apply 2d order polynomial relevant to that point


end