<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//en">

<!–Converted with LaTeX2HTML 2022 (Released January 1, 2022) –> <HTML lang="en"> <HEAD> <TITLE>Contents of Hexagonal Neighborhood</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0"> <META NAME="Generator" CONTENT="LaTeX2HTML v2022">

<LINK REL="STYLESHEET" HREF="tutorial.css">

<LINK REL="previous" HREF="node6_mn.html"> <LINK REL="up" HREF="node5_mn.html"> <LINK REL="next" HREF="node8_mn.html"> </HEAD>

<BODY bgcolor="#ffffff" text="#000000" link="#9944EE" vlink="#0000ff" alink="#00ff00">

<H2><A ID="SECTION00052000000000000000"> Hexagonal Neighborhood</A> </H2> Hexagonal neighborhoods exhibit properties desirable in the simulation of many physical systems. Fortunately, they are quite easy to build in <EM>Cellang 2.0</EM>. Simply imagine taking a hexagon and squeezing in at the sides, yielding a two cell stack. Doing this for the entire cell universe is depicted in Figure&nbsp;<A HREF="node6_ct.html#hexagons"><IMG ALT="[*]" SRC="crossref.png"></A>. The solid lines show the boundary of the original hexagon. The sides of the hexagons have been labeled, clockwise from the top, n (north), ne (north east), se (south east), s (south), sw (south west) and nw (north west).

<P> In order to have the cells act as sets of 2 block stacks, a <TT>which</TT> field with the value pattern depicted in Figure&nbsp;<A HREF="node6_ct.html#which_hexagon"><IMG ALT="[*]" SRC="crossref.png"></A> is used. The value 1 represents the top cell in a pair, while 0 denotes the bottom cell. Note that the top cell of a pair gets its s (south) value by skipping over the bottom cell of the pair, likewise the bottom cell skips over the top one for its n (north) value. Thus each cell pair agrees on the relative location of neighboring values. Note that this requires that initial (and subsequent) values for fields of cells given as input must be coordinated with the assignment to the <TT>which</TT> fields, otherwise one or more cell pairs will have only one of the pair getting the desired value.<A NAME="tex2html16" HREF="footnode_mn.html#foot335" TARGET="footer"><SUP>6</SUP></A> <P>

<DIV class="CENTER"><A ID="dist"></A><A ID="263"></A> <TABLE> <CAPTION class="BOTTOM"><STRONG>Figure:</STRONG> Calculating distance with hexagonal neighborhood</CAPTION> <TR><TD><IMG STYLE="height: 261.66ex; " SRC="img11.png" ALT="

\begin{figure}\begin{center}
<tex2html_unfinished_mark>verbatim1 ...