Professional Documents
Culture Documents
Distance On A Hexagonal Grid
Distance On A Hexagonal Grid
[9] P. S. Poretski, ."La loi des racines en logique," Rev. de Math., vol. [17] A. Thayse, "On some iteration properties of Boolean functions,"
6, pp. 5-8, 1896. Philips. Res. Rep., vol. 28, pp. 107-119, 1973.
[10] C. Reischer and D. A. Simovici, "Associative algebraic structures
in the set of Boolean functions and some applications in automa-
ta theory," IEEE Trans. Computers, vol. C-20, pp. 298-303, .- Sergiu Rudeanu was born on February 9,
1971. 1935 in Iasi, Romania. He graduated and re-
[11] S. Rudeanu, "Solutions non redondantes des equations Boo- ceived the Ph.D. degree in mathematics from
leennes," Bull. Math. Soc. Sci. Math. Phys. R. P. Roumaine, vol. the University of Bucharest, Bucharest, Ro-
7, pp. 45-49, 1963.
[12] -, "Remarks on Motinori Goth's papers on Boolean equa- nmania, in 1957 and 1964, respectively.
tions," Rev. Roumaine Math. Pures AppI., vol. 10, pp. 311-317, From 1958 to 1968 he was a Research Scien-
1965. tist at the Institute of Mathematics of the Ro-
[131 "Irredundant solutions of Boolean and pseudo-Boolean manian Academy, Bucharest. Since 1968 he
equations," Rev. Roumaine Math. Pures Appl., vol. 11, pp. 183- f[ _l has been an Associate Professor with the Fac-
188, 1966 ulty of Mathematics at the University of Bu-
[14] -, Boolean Functions and Equations. Amsterdam/London: A _ charest. During the period 1974-1976 he was
North-Holland Publ. Co., 1974. with the Institute of Mathematics at the University of Oran, Es-Senia,
[151 --, "An algebraic approach to Boolean equations," IEEE Algeria. His fields of interest are lattice theory and Boolean algebra
Trans. Computers, vol. C-23, 1974.
[16] E. Schroder, Vorlesungen uber die Algebra der Logik. Leipzig, with applications to switching theory, integer , programming, and
vol. 1, 1890; vol. 2, 1891, 1905; vol. 3, 1895. Reprint, Bronx, NY; graph theory. He has published about 50 research papers and 3 books
Chelsea, 1966. in these areas.
<: Correspondence.
Distance on a Hexagonal Grid d4(i,j), (h,k)) -Ili - hl + Ij - kl.
ED LUCZAK AND AZRIEL ROSENFELD We can define an 8-path from (i,j) to (h,k) analogously, ex-
cept that we allow diagonal, as well as horizontal and vertical,
Abstract-A simple formula is derived for the distance be- neighbors. The chessboard distance between (i,j) and (h,k) is
tween two points on a hexagonal grid, in terms of coordinates defined as the length of the shortest such 8-path, and it can be
F with respect to a pair of oblique axes. shown that this is given by
Index Terms-Distance, hexagonal grid, pattern recognition, d8((i,j), (h,k)) = max (Ii - hl, i - kl).
picture processing. It can be verified that both d4 and d8 are metrics, which
means that for all points (i,j), (h,k), and (u,v) we have
Distance functions, or metrics, on digital pictures have been
used in a number of picture processing applications [1, section d((i,j), (h,k)) = 0 if and only if
8.3]. Such functions are usually defined on the conventional (i,j) = (h,k) (positive definiteness)
Cartesian grid. It is well known that there are certain advan-
tages in using a hexagonal rather than a Cartesian grid to rep- d((i,j), (h,k)) = d((h,k), (i,j)) (symmetry)
resent a digital picture, and picture operations based on such
grids have been studied by various authors (e.g., [2]-[5]). The d((i,j), (h,k)) < d((i,j), (u,v))
purpose of this note is to develop a simple formula for dis- + d((u,v), (h,k)) (the triangle inequality)
tance on a hexagonal grid.
We first briefly review some basic results for the Cartesian for both d = d4 and d = d8.
case. Let (i,j) and (h,k) be two grid points, and define a 4- Suppose now that we are given a hexagonal grid such as that
path from (i,j) to (h,k) as a sequence of points shown (partially and approximately) in Fig. 1. We can intro-
**X(i,) = (io,jo), (il,jl), - --, (inj,j) = (h,k) duce a coordinate system on such a grid by using any two of
the three axes shown in the figure, say x and y. Given any
in which (ir,jr) is a horizontal or vertical neighbor of point P on the grid, we can reach P from the origin by making
(ir-,Jr-i) 1 S< r S n. The city block distance between (i,j) an integer number r of moves (positive, negative, or zero) in
and (h,k) is defined as the length of the shortest such 4-path the +x direction, and then an integer number s of moves in
(i.e., the one having smallest n). It is not hard to see that this the +y direction; then (r,s) are the coordinates of P. In the re-
distanceis given by mainder of the discussion, the oblique coordinates of a point
will always be given with respect to the x and y axes of Fig. 1.
The x, y, and z axes divide the plane into six sextants,
Manuscript received May 19, 1975; revised October 21, 1975. This which we shall number counterclockwise beginning at the +x
workwas supported by the Division of Computing Research, National axis, as shown in Fig. 1. It is easily verified that coordinates of
Science Foundation under Grant GJ-32258X.
The authors are with the Computer Science Center, University of points lying in these sextants can be characterized as follows.
Maryland, College Park, MD 20742. Note that the z-axis is the locus of points such that r + s = 0.
CORRESPONDENCE 533
II
Sextant r s r+s z y