Dan Luecking | 31 May 2012 04:37
Picon
Favicon

Re: [NTG-context] MetaPost transformation

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)

Troy Henderson | 31 May 2012 05:44
Picon

Re: [metapost] MetaPost transformation

Thanks Dan.  This is much better than what I was doing.

Troy

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Gmane