/* */ /* this script does the shift/rotation usually done in sort4migvxyz */ /* the header words SrPtXC,SrPtYC,RcPtXC,RcPtYC,SrRcMX and SrRcMY are updated */ /* The old values of SrPtXC,SrPtYC,RcPtXC and RcPtYC are stored in */ /* CDPBCX,CDPBCY,SrPrLt and SrPrLn */ /* author: clarkera@bp.com */ /* */ func Begin() { /* here are the input parameters */ shift1x = 518942.562500; shift1y = 6224729.500000; shift2x = 0.000000; shift2y = 0.000000; angle = 9.257400; angle = Pi / 180.0 * angle; sn = sin(angle); cs = cos(angle); } func OnLineHeader () { output(LH); } func OnTrace () { sx = Tr.SrPtXC; sy = Tr.SrPtYC; rx = Tr.RcPtXC; ry = Tr.RcPtYC; mx=sx-shift1x; my=sy-shift1y; sx= cs*mx+sn*my-shift2x; sy=-sn*mx+cs*my-shift2y; mx=rx-shift1x; my=ry-shift1y; rx= cs*mx+sn*my-shift2x; ry=-sn*mx+cs*my-shift2y; cmpx=(sx+rx)/2.0; cmpy=(sy+ry)/2.0; /* store the old header values in some unused header words */ Tr.CDPBCX = Tr.SrPtXC; Tr.CDPBCY = Tr.SrPtYC; Tr.SrPrLt = Tr.RcPtXC; Tr.SrPrLn = Tr.RcPtYC; Tr.SrPtXC = sx; Tr.SrPtYC = sy; Tr.RcPtXC = rx; Tr.RcPtYC = ry; Tr.SrRcMX = cmpx; Tr.SrRcMY = cmpy; output(Tr); }