ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Dan Luecking <luecking@uark.edu>
To: Troy Henderson <thenders@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	MetaPost List <metapost@tug.org>
Subject: Re: [NTG-context] MetaPost transformation
Date: Wed, 30 May 2012 21:37:51 -0500	[thread overview]
Message-ID: <201205310237.q4V2bpps018883@comp.uark.edu> (raw)
In-Reply-To: <CAFP+xFJmoZ0PBWK=91SY7jPmEa_4gWGSBHfnt6S659jEiQCbAg@mail.g mail.com>

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;
   T := mktransform (1,2,3,4,5,6);
   show T;
produces:
 >> (1,2,3,4,5,6)

Regards,
Dan


Daniel H. Luecking
Department of Mathematical Sciences
Fayetteville, Arkansas
http://www-cs-faculty.stanford.edu/~knuth/iaq.html 

--
http://tug.org/metapost/


  parent reply	other threads:[~2012-05-31  2:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 21:10 Troy Henderson
2012-05-30 21:30 ` Hans Hagen
2012-05-31  0:56   ` Troy Henderson
     [not found]     ` <CAFP+xFJmoZ0PBWK=91SY7jPmEa_4gWGSBHfnt6S659jEiQCbAg@mail.g mail.com>
2012-05-31  2:37       ` Dan Luecking [this message]
2012-05-31  3:44         ` [metapost] " Troy Henderson
2012-05-31  7:00 ` Albrecht Kauffmann
2012-05-31 12:31   ` Troy Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201205310237.q4V2bpps018883@comp.uark.edu \
    --to=luecking@uark.edu \
    --cc=metapost@tug.org \
    --cc=ntg-context@ntg.nl \
    --cc=thenders@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).