From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67314 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Metfun macro for triangle Date: Thu, 24 Mar 2011 09:59:09 +0100 Message-ID: <33B6C5DE-9240-4A26-9AE9-F0C362769AB2@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1300957165 12581 80.91.229.12 (24 Mar 2011 08:59:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2011 08:59:25 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Mar 24 09:59:21 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 1Q2gO1-0000zb-1Q for gctc-ntg-context-518@m.gmane.org; Thu, 24 Mar 2011 09:59:21 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7FD74CAB46; Thu, 24 Mar 2011 09:59:06 +0100 (CET) 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 ycomxowfvLhj; Thu, 24 Mar 2011 09:59:03 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 718CDCAB31; Thu, 24 Mar 2011 09:59:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 688BACAB31 for ; Thu, 24 Mar 2011 09:59:02 +0100 (CET) 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 jhBvfjyPaTvz for ; Thu, 24 Mar 2011 09:59:00 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 82C8BCAAFF for ; Thu, 24 Mar 2011 09:59:00 +0100 (CET) Original-Received: from mail-wy0-f169.google.com (mail-wy0-f169.google.com [74.125.82.169]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p2O8xDbl009010 for ; Thu, 24 Mar 2011 09:59:13 +0100 Original-Received: by wyf19 with SMTP id 19so10950253wyf.14 for ; Thu, 24 Mar 2011 01:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:content-type:content-transfer-encoding :subject:date:message-id:to:mime-version:x-mailer; bh=XRLLEDtZexEcbM2EZLrCGhq7fMdh7MaPumSc9o5G10g=; b=WfU4Y7X4g+HHdcA8iKQxgYR6vPeAtypTmDQQZfVzmWdAEGR3RdaM0+RfVmjQfIe7Ri tlx1dU6ZpAfX1mV9e3SHPmUSPQdJI36R1JD5/6rFGPmOa4cQ1dBdcmDG6vtiEDRE4q4n 9g8fTjsbix6XSbhrHoS52tIAz0mapqX1W5HCU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=V/jTPqtpv+ot2QQO+iKJwEn4uYW6VMwg8isJQFkeAeauQm7nZlUCrR4z/udMwcMYvb ahcT7o9WdedVOGo/Ck6IR5ZZCcL49QCAoHDqGnacHezrmKiPU611vIk1XHh9/yRYTcEb Mtf88qAGFQ5CzpuWc1XlJlTBujqiiIm/nhqCs= Original-Received: by 10.216.46.135 with SMTP id r7mr458698web.21.1300957153286; Thu, 24 Mar 2011 01:59:13 -0700 (PDT) Original-Received: from [192.168.0.10] (mna75-3-82-66-231-76.fbx.proxad.net [82.66.231.76]) by mx.google.com with ESMTPS id o23sm4209195wbc.27.2011.03.24.01.59.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2011 01:59:11 -0700 (PDT) X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08EmUXdkg - 2e9c99a77a79 - 20110324 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 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:67314 Archived-At: Hi all, I have a document in which I must draw several triangles for which two summits, say z0, z1, and the length of the two other sides are known, so that the third summit, say z2, is completly determined. In order to draw one triangle the following works fine: \setupcolors[state=start] \starttext \startMPcode z0 = (0cm,0cm) ; z1 = (5cm,0cm) ; path p, q ; pickup pencircle scaled 2mm ; drawdot z0 ; drawdot z1 ; p := halfcircle scaled 8 cm ; % twice the length of the second side at z0 p := p shifted z0 ; q := halfcircle scaled 6 cm ; % twice the length of the second side at z1 q := q shifted z1 ; z2 = p intersectionpoint q ; drawdot z2 ; pickup pencircle scaled 1mm ; draw z0--z1--z2--cycle withcolor blue ; \stopMPcode \stoptext However I would like to have a macro, for instance named Triangle, which accepts four arguments z0,z1, length_1, length_2, so that in a MetaPost code i can use draw Triangle(z0,z1, 4, 3) withcolor blue ; in order to draw the above triangle. Has anyone any idea about how to do this? Thanks in advance for your help: OK ___________________________________________________________________________________ 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 ___________________________________________________________________________________