31 May 2012 04:37
Re: [NTG-context] MetaPost transformation
Dan Luecking <luecking <at> uark.edu>
2012-05-31 02:37:51 GMT
2012-05-31 02:37:51 GMT
At 07:56 PM 5/30/2012, Troy Henderson wrote: >Well then in case anyone needs such a transformation, I've >constructed the (non-unique) transformation T > > > t:=angle(f,e); > > q:=e++f; > > p:=(c*f-d*e)/q; > > s:=(c*e+d*f)/(q**2); > > transform T; > > T:=identity rotated t xscaled p yscaled q slanted s shifted (a,b); > >This yields T=(a,b,c,d,e,f). You can implement something like what you wanted directly because, just as you can write equations for the parts of a pair, you can also write equations for the parts of a transform: vardef mktransform (expr a,b,c,d,e,f) = save T_; transform T_; xpart T_ = a; ypart T_ = b; xxpart T_ = c; xypart T_ = d; yxpart T_ = e; yypart T_ = f; T_ enddef; After this transform T;(Continue reading)
RSS Feed