From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50044 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: How can I compare picture variables in metapost? Date: Tue, 5 May 2009 22:10:19 -0400 (EDT) Message-ID: References: <769ba7780905050527o4f42f9acod279bcce641189c@mail.gmail.com> <4A00366A.1040907@elvenkind.com> <769ba7780905050651l6c8601aer421b04c1b7e1c20c@mail.gmail.com> <4A00556C.5000503@elvenkind.com> <769ba7780905050819o68b79a5ek4741bfbb6fded7b6@mail.gmail.com> <4A0063F6.3050408@elvenkind.com> <4A006F29.70801@elvenkind.com> <4A00B2B0.2080008@gmx.net> <769ba7780905051846l5865bd52vd4ae89aaa09a37ff@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1241575928 7469 80.91.229.12 (6 May 2009 02:12:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2009 02:12:08 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed May 06 04:11:59 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1M1Wc0-0006jF-RI for gctc-ntg-context-518@m.gmane.org; Wed, 06 May 2009 04:11:56 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 54CF51FCF4; Wed, 6 May 2009 04:11:56 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18470-07; Wed, 6 May 2009 04:10:56 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 264EE1FCDD; Wed, 6 May 2009 04:10:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C8DCC1FCDD for ; Wed, 6 May 2009 04:10:53 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18471-08 for ; Wed, 6 May 2009 04:10:41 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by ronja.ntg.nl (Postfix) with ESMTP id C4D9A1FCC6 for ; Wed, 6 May 2009 04:10:41 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.161]) by filter1-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n462AdLt013467 for ; Wed, 6 May 2009 04:10:40 +0200 Original-Received: FROM [192.168.2.8] (c-76-127-178-8.hsd1.ct.comcast.net [76.127.178.8]) By tombraider.mr.itd.umich.edu ID 4A00F19E.9EEEC.10033 ; Authuser adityam; 5 May 2009 22:10:38 EDT In-Reply-To: <769ba7780905051846l5865bd52vd4ae89aaa09a37ff@mail.gmail.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.93.161; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 219862774 - f1c2ec8ac20c - 20090506 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:50044 Archived-At: On Wed, 6 May 2009, Zhichu Chen wrote: > To Aditya: Clearly I over-emphasized the randomness. Actually, what I > meant is a little more complex: identical objects on random > coordinates and they don't intersect with each other. We can rotate > them but we can't re-size them and scale them. The difficult part in this case is recognizing that either the input is infeasible (you cannnot put 100 circles of radius 1 in a 10x10 square), or that a particular random sample is stuck and you need to restart. > Your code is very > interesting. I'll see what I can do now. Both Taco's and my solutions can be adapted so that you do not randomize the radius. (Taco's solution will also work for arbitrary object that can then be rotated by a random amount). Another option that you can consider (if you only want the result to look random), is to start with a uniform placement on a grid and then move objects around by a small amount randomly. This will give an appearance that they are placed at random. Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________