From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50050 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: How can I compare picture variables in metapost? Date: Wed, 06 May 2009 11:06:42 +0200 Message-ID: <4A015322.8010704@gmx.net> 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> 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 1241600867 31472 80.91.229.12 (6 May 2009 09:07:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2009 09:07:47 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed May 06 11:07:37 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 1M1d6H-0000Sf-HK for gctc-ntg-context-518@m.gmane.org; Wed, 06 May 2009 11:07:37 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 829C01FD0A; Wed, 6 May 2009 11:07:35 +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 25096-06; Wed, 6 May 2009 11:07:00 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6A5201FC87; Wed, 6 May 2009 11:07:00 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0D2F61FC82 for ; Wed, 6 May 2009 11:06:59 +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 23485-05 for ; Wed, 6 May 2009 11:06:51 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by ronja.ntg.nl (Postfix) with ESMTP id 5B8261FC87 for ; Wed, 6 May 2009 11:06:51 +0200 (CEST) Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by filter4-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with SMTP id n4696ix6016613 for ; Wed, 6 May 2009 11:06:45 +0200 Original-Received: (qmail invoked by alias); 06 May 2009 09:06:44 -0000 Original-Received: from i577BCD21.versanet.de (EHLO [192.168.1.3]) [87.123.205.33] by mail.gmx.net (mp042) with SMTP; 06 May 2009 11:06:44 +0200 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX1+Wy9w7U2CWi4SbS5umbfEQZKrW8dx/AzrabIplNa FrT14An2SZumcz User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-FuHaFi: 0.59 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.20; country=DE; region=01; city=Karlsruhe; latitude=49.0047; longitude=8.3858; http://maps.google.com/maps?q=49.0047,8.3858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 220056795 - 8bfef8b861ca - 20090506 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 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:50050 Archived-At: Aditya Mahajan schrieb: > On Tue, 5 May 2009, Peter Rolf wrote: > >> Taco Hoekwater schrieb: >>> Taco Hoekwater wrote: >>>> Zhichu Chen wrote: >>>>> >>>>> Seems that I don't have too many choices. Maybe using lua to do the >>>>> math and throwing the result to metapost is faster? I think I can do >>>>> this, but I don't know how. The documents are a little limited. >>>> >>>> For circles, probably lua calculations will be faster because the >>>> data manipulation will be a bit easier. But for non-circle paths, >>>> you are better off with a metapost solution because of lua not >>>> knowing about the actual paths. >>> >>> linear search does seem to do that badly, here is a stub: >>> >> Mhh... isn't it easier to just test, if the distance (centerpoint to >> centerpoint) from the new circle >> to all already found circles is greater (or equal) than the sum of >> the radii? > > Depends on what you mean by "does not intersect". Taco's solution only > checks if the curves intersect or not. So, it is possible to have two > concentric circles. If you check for distance you get circles which do > not overlap. > aye > Of course, in case of circles, non-overlap can also be tested > mathmeaticically. > > if |c_1 - c_2| < max(r_1, r_2) then > |c_1 - c_2| < |r_1 - r_2| > else > |c_1 - c_2| > r_1 + r_2 > end > >> Anyhow an interesting and hard problem (I guess O(n!) ? ). > > I think it is O(n^3).You only have to check all combinations (which is > O(n^2)) and do that for each point that you add add. You are the mathematician, so you are *probably* right here :) Best wishes, Peter > > 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 > ___________________________________________________________________________________ > > ___________________________________________________________________________________ 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 ___________________________________________________________________________________