From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71886 Path: news.gmane.org!not-for-mail From: Paul Menzel Newsgroups: gmane.comp.tex.context Subject: Re: MetaFun: Confusion with `function()` and `xyscaled` Date: Fri, 21 Oct 2011 13:38:01 +0200 Message-ID: <1319197081.3766.32.camel@mattotaupa> References: <1319152475.12677.8.camel@mattotaupa> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0210311534==" X-Trace: dough.gmane.org 1319197100 11412 80.91.229.12 (21 Oct 2011 11:38:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 Oct 2011 11:38:20 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 21 13:38:13 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RHDQT-0005BL-Bo for gctc-ntg-context-518@m.gmane.org; Fri, 21 Oct 2011 13:38:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0021ECB084; Fri, 21 Oct 2011 13:38:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7OOnK7LJAbXv; Fri, 21 Oct 2011 13:38:09 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4D2A1CB081; Fri, 21 Oct 2011 13:38:09 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B8A89CB081 for ; Fri, 21 Oct 2011 13:38:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mEvS3Jlc40a7 for ; Fri, 21 Oct 2011 13:38:05 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 1DD57CB07F for ; Fri, 21 Oct 2011 13:38:05 +0200 (CEST) Original-Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p9LBc3pi024054 for ; Fri, 21 Oct 2011 13:38:04 +0200 Original-Received: from f053040166.adsl.alicedsl.de ([78.53.40.166] helo=[192.168.178.21]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1RHDQT-0006cM-5t for ntg-context@ntg.nl; Fri, 21 Oct 2011 11:38:13 +0000 In-Reply-To: <1319152475.12677.8.camel@mattotaupa> X-Mailer: Evolution 3.0.3-2 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=188.40.100.199; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0xFLnC3qh - e8af42d6a3aa - 20111021 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:71886 Archived-At: --===============0210311534== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-SIAoMz4HqjR4DP61ZF0p" --=-SIAoMz4HqjR4DP61ZF0p Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Freitag, den 21.10.2011, 01:14 +0200 schrieb Paul Menzel: > Dear ConTeXt/MetaFun folks, >=20 >=20 > looking at the example for grid and functions in the MetaFun manual [1] > section 9.3 >=20 > drawoptions(withpen pencircle scaled .25pt withcolor .5white) ; > draw hlingrid(0, 20, .2, 20cm, 10cm) ; > draw vloggrid(0, 10, .5, 10cm, 20cm) ; > drawoptions(withpen pencircle scaled .50pt) ; > draw hlingrid(0, 20, 1, 20cm, 10cm) ; > draw vloggrid(0, 10, 1, 10cm, 20cm) ; > =20 > fmt_pictures :=3D false ; % use TeX as formatting engine > textextoffset :=3D ExHeight ; % a variable set by ConTeXt > draw hlintext.lft(0, 20, 5, 20cm, "@3e") ; > draw vlogtext.bot(0, 10, 9, 10cm, "@3e") ; > =20 > draw > function(1,"log(x)","x",1,10,1) xyscaled (10cm,2cm) > withpen pencircle scaled 5mm withcolor transparent(1,.5,yellow) ; >=20 > I am confused how the resulting function is scaled correctly. The > resulting dimensions seem to be 10cm and 18 cm. So I guess the 2 cm mean > to shift it up some how. >=20 > Could someone please explain to me how `xyscaled` works in this case > please. I though `xyscaled (=CE=B1cm, =CE=B6cm)` would set the object/pat= h to a > width of =CE=B1 cm and a height of =CE=B6 cm. Looking up the definition of the macro `xyscaled` it is indeed just a short version of `xscaled =CE=B1cm yscaled =CE=B6cm`. $ more mp-tool.mp [=E2=80=A6] %D More robust: =20 % let normalscaled =3D scaled ; % let normalxscaled =3D xscaled ; % let normalyscaled =3D yscaled ; % % def scaled expr s =3D normalscaled (s) enddef ; % def xscaled expr s =3D normalxscaled (s) enddef ; % def yscaled expr s =3D normalyscaled (s) enddef ; =20 %D Shorter =20 primarydef p xyscaled q =3D begingroup ; save qq ; pair qq ; qq =3D paired(q) ; ( p if xpart qq<>0 : xscaled (xpart qq) fi if ypart qq<>0 : yscaled (ypart qq) fi ) endgroup enddef ; [=E2=80=A6] I am still confused though what happens in the above example scaling the path of the function. Trying \starttext \startMPcode draw fullsquare xscaled 10cm yscaled 2cm; \stopMPcode \stoptext the resulting rectangle has the dimensions of 10 cm width and 2 cm height but the path of the function above does not. Thanks, Paul > [1] http://www.pragma-ade.com/general/manuals/metafun-s.pdf --=-SIAoMz4HqjR4DP61ZF0p Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk6hWZkACgkQPX1aK2wOHVi6zQCfROakMhGDL8P0VHDIscjmft9m dUkAn1EeaDL5z/zS+l1Rd5zhjl4fJiqN =ogdH -----END PGP SIGNATURE----- --=-SIAoMz4HqjR4DP61ZF0p-- --===============0210311534== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@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 ___________________________________________________________________________________ --===============0210311534==--