swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Modelling] calculating distance on a torus


From: Konrad_Richter
Subject: Re: [Swarm-Modelling] calculating distance on a torus
Date: Mon, 10 Oct 2005 22:01:02 +0200


If you mean by torus just that it is a grid that is self-closed (ie, you walk out on one side & come back on the other), the distance should be something like
sqrt(min(|x1-x2|,X-|x1-x2|)^2+min(|y1-y2|,Y-|y1-y2|)^2) where X and Y denote the grid size in x and y-size respectively.
Cheers,
        Konrad
       
______________________________________        
       
Konrad Richter
McKinsey & Company, Inc.
Herrengasse 1-3
A-1010 Wien
Austria
       
Phone +43 1 5370-6160
Fax +43 1 5370-6161
Mobile +49 175 318-6160
       



address@hidden
Sent by: address@hidden

10.10.2005 21:02

Please respond to
Swarm Modelling <address@hidden>

To
address@hidden
cc
Subject
[Swarm-Modelling] calculating distance on a torus





Hello,

Could anyone point me in the direction of some code for calculating
Euclidean distance between two coordinates [(x1, y1) and (x2, y2)] on a
torus?  I imagine one would calculate distance a bit differently on a
torus than on a grid, so I thought I'd quickly check to see if anyone
had already tackled this problem before setting out to do so myself.
Thanks for your time,

Luke Premo
anthropology
u of arizona

_______________________________________________
Modelling mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/modelling



+=========================================================+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+=========================================================+





reply via email to

[Prev in Thread] Current Thread [Next in Thread]