From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76558 Path: news.gmane.org!not-for-mail From: Dan Luecking Newsgroups: gmane.comp.tex.metapost,gmane.comp.tex.context Subject: Re: [NTG-context] MetaPost transformation Date: Wed, 30 May 2012 21:37:51 -0500 Message-ID: <201205310237.q4V2bpps018883@comp.uark.edu> References: <4FC69178.8020300@wxs.nl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338431938 17377 80.91.229.3 (31 May 2012 02:38:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 31 May 2012 02:38:58 +0000 (UTC) Cc: mailing list for ConTeXt users , MetaPost List To: Troy Henderson Original-X-From: metapost-bounces@tug.org Thu May 31 04:38:57 2012 Return-path: Envelope-to: gctm-metapost-5@gmane.org Original-Received: from tug.org ([130.225.2.178]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SZvHr-0002Um-1K; Thu, 31 May 2012 04:38:55 +0200 Original-Received: from tug.org (localhost [127.0.0.1]) by tug.org (8.14.5/8.14.5) with ESMTP id q4V2cWBj015875; Thu, 31 May 2012 04:38:33 +0200 X-Envelope-From: luecking@uark.edu X-Envelope-To: Original-Received: from mailglue.nfit.au.dk (nfitmail.nfit.au.dk [130.225.31.129]) by tug.org (8.14.5/8.14.5) with ESMTP id q4V2cP96015530 for ; Thu, 31 May 2012 04:38:30 +0200 Original-Received: from mx.nfit.au.dk (unknown [10.19.8.20]) by mailglue.nfit.au.dk (Postfix) with ESMTP id 48BE2628AE for ; Thu, 31 May 2012 04:38:25 +0200 (CEST) Original-Received: from SRVUNIHUB02.uni.au.dk (mail-out.au.dk [130.225.30.1]) by mx.nfit.au.dk (Postfix) with ESMTP id 368496014F for ; Thu, 31 May 2012 04:38:25 +0200 (CEST) Original-Received: from mail.nfit.au.dk (10.88.100.13) by SRVUNIHUB02.uni.au.dk (10.88.2.7) with Microsoft SMTP Server id 14.2.247.3; Thu, 31 May 2012 04:38:15 +0200 Original-Received: from mail.nfit.au.dk (localhost [127.0.0.1]) by mail.nfit.au.dk (Postfix) with ESMTP id 983F6E656B for ; Thu, 31 May 2012 04:38:13 +0200 (CEST) Original-Received: from comp.uark.edu (comp.uark.edu [130.184.5.197]) by mail.nfit.au.dk (Postfix) with ESMTPS id 388C1E6568 for ; Thu, 31 May 2012 04:38:13 +0200 (CEST) Original-Received: from DrZoidberg.uark.edu (adsl-69-152-193-35.dsl.fyvlar.swbell.net [69.152.193.35]) (authenticated bits=0) by comp.uark.edu (8.13.6/8.13.4) with ESMTP id q4V2bpps018883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 30 May 2012 21:37:52 -0500 (CDT) X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 In-Reply-To: Original-References: <4FC69178.8020300@wxs.nl> X-NFIT-ADSL: 0 X-NFIT-RelayAddr: 130.225.30.1 X-NFIT-MX: True X-Scanned-By: MIMEDefang 2.71 X-Sim: 18100ad0001c45ccc10154b17f8ce05d2d2ae3905bf54b9736d6add4f477aacd 1069 X-NFIT-Solido-Score: 3. X-NilSimsa-Score: 62/128 X-Scanned-By: MIMEDefang 2.71 X-Scanned-By: MIMEDefang 2.71 on 10.19.8.20 X-Scanned-By: MIMEDefang 2.71 on 10.19.8.21 X-BeenThere: metapost@tug.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "MetaPost discussion." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: metapost-bounces@tug.org Original-Sender: metapost-bounces@tug.org Xref: news.gmane.org gmane.comp.tex.metapost:2078 gmane.comp.tex.context:76558 Archived-At: 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/