1998Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: Hex&#45;grid mapping -->
<!--X-From-R13: @nguna T Kbfcr <lbfcrNunjnvv.rqh> -->
<!--X-Date: Wed, 2 Dec 1998 13:45:59 &#45;0800 -->
<!--X-Message-Id: Pine.GSO.3.96.981202113903.26079B&#45;100000@uhunix2 -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 9812012258380A.09289@d185d1e96 -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: Hex-grid mapping</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:yospe#hawaii,edu">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00889.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00891.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00887.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00880.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00890">Author</A>
&nbsp;|&nbsp;<A HREF="#00890">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00890">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: Hex-grid mapping</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: Hex-grid mapping</LI>
<LI><em>From</em>: Nathan F Yospe &lt;<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>&gt;</LI>
<LI><em>Date</em>: Wed, 2 Dec 1998 11:44:25 -1000</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Tue, 1 Dec 1998, James Wilson wrote:

:On Tue, 01 Dec 1998, Jon Leonard wrote:
:&gt;On Tue, Dec 01, 1998 at 07:51:24PM -0500, James Wilson wrote:

:&gt;Would you have been happier if I'd drawn my hexes like this?
:&gt;
:&gt;        / \   / \   / \   / \
:&gt;       /   \ /   \ /   \ /   \
:&gt;      | 0,2 | 1,2 | 2,2 | 3,2 |
:&gt;      |     |     |     |     |
:&gt;     / \   / \   / \   / \   /
:&gt;    /   \ /   \ /   \ /   \ /
:&gt;   | 0,1 | 1,1 | 2,1 | 3,1 |
:&gt;   |     |     |     |     |
:&gt;  / \   / \   / \   / \   /
:&gt; /   \ /   \ /   \ /   \ /
:&gt;| 0,0 | 1,0 | 2,0 | 3,0 |
:&gt;|     |     |     |     |
:&gt; \   / \   / \   / \   /
:&gt;  \ /   \ /   \ /   \ /

:&gt;Those are really hexagons...  And the six neighbors have the coordinate
:&gt;deltas I specified.  The fact that they don't look pretty in ASCII graphics
:&gt;says little about the math.

:&gt;That they're best stored in memory as a two dimensional array doesn't change
:&gt;how the geometry works.  Two of the "corner" diagonals are as adjacent as the
:&gt;"sides", and the other two diagonals are farther away than with a square
:&gt;geometry.

:&gt;The underlying mathematics are that if you try to do coordinate geometry with
:&gt;axes 60 degrees apart, the distance function changes to d=sqrt(x*x-x*y+y*y),
:&gt;and the lattice points wind up being the centers of packed hexagons.

:nevertheless there are eight neighbors of each node, not six. perhaps he doesn't
:care about that.

There are six valid neighbors. sqrt(x^2 - xy + y^2) has six solutions of
value one - meaning six neighbors. I've used this myself, when working a
hex-mapped structure. Far simpler. And the guy who showed it to me is an
extremely good combinatoric mathematician. He's finishing a PhD in math,
at Stanford, no less, and when he showed me this, he couldn't resist the
urge to prove to me that it was, indeed, the *theoretical* best solution
to the problem, not just a nice one.
-- 

Nathan F. Yospe - Born in the year of the tiger, riding it forever after
University of Hawaii at Manoa, Dept of Physics, second year senior (joy)
(On Call) Associate Algorithm Developer, Textron Systems Corp, Maui Ops.
yospe#hawaii.edu <A  HREF="http://www2.hawaii.edu/~yospe">http://www2.hawaii.edu/~yospe</A> Non commercial email only



</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00884" HREF="msg00884.html">[MUD-Dev] Re: Hex-grid mapping</A></STRONG>
<UL><LI><EM>From:</EM> James Wilson &lt;jwilson#rochester,rr.com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00889.html">[MUD-Dev] Re: Hex-grid mapping (example from PSL empire)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00891.html">[MUD-Dev] Re: Hex-grid mapping</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00887.html">[MUD-Dev] Re: Hex-grid mapping</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00880.html">[MUD-Dev] Re: Hex-grid mapping</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00890"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00890"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: Hex-grid mapping</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00882" HREF="msg00882.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Wed 02 Dec 1998, 01:08 GMT
<UL>
<LI><strong><A NAME="00883" HREF="msg00883.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
Jon Leonard <a href="mailto:jleonard#divcom,slimy.com">jleonard#divcom,slimy.com</a>, Wed 02 Dec 1998, 01:53 GMT
<UL>
<LI><strong><A NAME="00884" HREF="msg00884.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Wed 02 Dec 1998, 04:07 GMT
<UL>
<LI><strong><A NAME="00887" HREF="msg00887.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
Par Winzell <a href="mailto:zell#alyx,com">zell#alyx,com</a>, Wed 02 Dec 1998, 06:48 GMT
</LI>
<LI><strong><A NAME="00890" HREF="msg00890.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Wed 02 Dec 1998, 21:45 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
<LI><strong><A NAME="00880" HREF="msg00880.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
Ling <a href="mailto:K.L.Lo-94#student,lboro.ac.uk">K.L.Lo-94#student,lboro.ac.uk</a>, Tue 01 Dec 1998, 22:14 GMT
<UL>
<LI><strong><A NAME="00885" HREF="msg00885.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Wed 02 Dec 1998, 06:02 GMT
</LI>
<LI><strong><A NAME="00891" HREF="msg00891.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Wed 02 Dec 1998, 21:50 GMT
</LI>
<LI><strong><A NAME="00898" HREF="msg00898.html">[MUD-Dev] Re: Hex-grid mapping</A></strong>, 
Alberto Barsella <a href="mailto:Alberto.Barsella#univ-lille1,fr">Alberto.Barsella#univ-lille1,fr</a>, Thu 03 Dec 1998, 10:02 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>