# A Continuous Coordinate System for the Plane by Triangular Symmetry

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Preliminaries

^{3}denotes the cubic grid, whose points are addressed by integer triplets, according to the three coordinates x, y, z.

#### 2.1. Discrete Triangular Coordinate System

#### 2.2. The Barycentric Coordinate System (BCS)

**Example**

**1.**

## 3. Continuous Coordinate System for Reflecting the Triangular Symmetry

^{(+)}or a

^{(−)}as the starting point in Equation (1).

**Proposition**

**1.**

**Proof.**

^{(+)}= (a

_{1}, a

_{2}, a

_{3}), a

^{(−)}= (a

_{1}, a

_{2}− 1, a

_{3}− 1), p = (p

_{1}, p

_{2}, p

_{3}), b = (b

_{1}, b

_{2}, b

_{3}), and c = (c

_{1}, c

_{2}, c

_{3}) where a

^{(+)}is the midpoint of the positive triangle and a

^{(−)}is the midpoint of the negative one (see Figure 7).

_{1}= b

_{1}= c

_{1}, b

_{2}= a

_{2}, c

_{3}= a

_{3}and c

_{2}= a

_{2}− 1,

_{1}= b

_{1}= c

_{1}, b

_{2}= a

_{2}, c

_{3}= a

_{3}and b

_{2}= a

_{2}− 1.

_{1}, from the positive triangle, we have the following.

_{1(+)}= a

_{1}+ v (b

_{1}− a

_{1}) + u (c

_{1}− a

_{1}) since a

_{1}= b

_{1}= c

_{1}then p

_{1(+)}= a

_{1}.

_{1(−)}= a

_{1}+ (1 − v) (b

_{1}− a

_{1}) + (1 – u) (c

_{1}− a

_{1}) then also p

_{1(−)}= a

_{1}.

_{2}, from the positive triangle, we have the following.

_{2(+)}= a

_{2}+ v (b

_{2}− a

_{2}) + u (c

_{2}− a

_{2}),

_{2}= a

_{2}, then:

_{2(+)}= a

_{2}+ u (c

_{2}− a

_{2}).

_{2}= a

_{2}− 1, we get p

_{2(+)}= a

_{2}− u.

_{2(−)}= (a

_{2}− 1) + (1 − v) (b

_{2}− (a

_{2}− 1)) + (1 − u) (c

_{2}− (a

_{2}− 1)),

_{2}= (a

_{2}− 1), it is:

_{2(−)}= (a

_{2}− 1) + (1 − u) (c

_{2}− (a

_{2}− 1)),

_{2}= a

_{2}, then we have p

_{2(−)}= a

_{2}− u.

_{3}, from the positive triangle, we have:

_{3(+)}= a

_{3}+ v (b

_{3}− a

_{3}) + u (c

_{3}− a

_{3}).

_{3}= a

_{3},

_{3(+)}= a

_{3}+ v (b

_{3}− a

_{3}).

_{3}= a

_{3}– 1, which yields to p

_{3(+)}= a

_{3}− v.

_{3(−)}= (a

_{3}− 1) + (1 − v) (b

_{3}− (a

_{3}− 1)) + (1 − u) (c

_{3}− (a

_{3}− 1)).

_{3}= a

_{3}− 1 and b

_{3}= a

_{3}, it can be written as:

_{3(−)}= (a

_{3}− 1) + (1 − v) (b

_{3}− (a

_{3}− 1)) = a

_{3}− v.

**Corollary**1.

_{1}, a

_{2}, a

_{3}), and corners b = (b

_{1}, b

_{2}, b

_{3}), c = (c

_{1}, c

_{2}, c

_{3}). Let the barycentric coordinates of p be (w, v, u), with w + v + u = 1, i.e., by assigning these weights to a and b and c, respectively, the weighted midpoint is at p. Then, the coordinates of p = (p

_{1}, p

_{2}, p

_{3}) are exactly p

_{i}= w a

_{i}+ v b

_{i}+ u c

_{i}for i = 1, 2, 3.

#### 3.1. Converting Triplets to Cartesian Coordinates

**Example**

**2.**

#### 3.2. Converting Cartesian Coordinates to Equivalent Triplets

- Step 1
- Which quarter of the Cartesian plane is involved? Note that the 1st and 3rd quarters have the same structure, while the 2nd and 4th quarters have another one.
- Step 2
- Which rectangle is involved (AB or CB)?
- Step 3
- Which area is involved (A, B, or C)?

**Code 1.**

- IF ((x ≥ 0) AND (y ≥ 0)) OR ((x < 0) AND (y < 0))
- THEN “1st or 3rd quarter”
- ELSE “2nd or 4th quarter”

**Code 2.**

- IF ((int ($2x/\sqrt{3}$) mod 2 = 0) AND (int (y/1.5) mod 2) = 0) OR
- (int ($2x/\sqrt{3}$) mod 2 = 1) AND (int (y/1.5) mod 2) = 1))
- THEN “CB Rectangle is involved”
- ELSE “AB Rectangle is involved”

- int takes the integer part of the (decimal) number,
- mod is the modulus (or remainder, here after division by two).

_{1}− y = 0,

_{2}− y = 0,

- m is the slope of L1 and L2, which is a constant here, equal to $\left(-\sqrt{3}/3\right)$,
- r
_{1}and r_{2}are the y-axis intercept with L1 and L2, respectively, where r_{2}= r_{1}+ 1

**Code 3.**

- IF ((r
_{1}$-x\sqrt{3}/3$ − y) ≤ 0) AND ((r_{2}$-x\sqrt{3}/3$ − y) ≥ 0) - THEN “Area A is involved”
- ELSE “Area B is involved”

_{1}, in area AB, is computed by computing any point (x, y) on Line 1. Therefore, the point at the bottom-right corner of rectangle AB is computed for this purpose (see the red point in Figure 10). Hence, Equation (5) is used to find the value of r

_{1}. In Equation (5), we used the modulus (mod) as a function naturally extended to real numbers, i.e., it gives the remainder after the division by a real number (and that is between 0 and the divisor). Moreover, by adding 1 to r

_{1}, we get the value of the y-axis intercept with Line 2, r

_{2}(see Code 3).

**Example**

**3.**

- Step 1
- The 1st or 3rd quarter is involved.
- Step 2
- It’s odd and even. Therefore, rectangle AB is involved.
- Step 3
- Area A is matched.

- (1)
- i =$\langle 0.75\rangle +\langle 0.15\rangle $= 1 + 0 = 1
- (2)
- k = 1 −$\frac{2x}{\sqrt{3}}\approx $−0.500.
- (3)
- j$\approx $−y + 0.5 · 0.5 = −0.2

**Example**

**4.**(Point in Area B)

- (a)
- Converting from Continuous Coordinate System to CCS.

- Step 1
- It belongs to the 1st quarter.
- Step 2
- It belongs to rectangle CB.
- Step 3
- Area B is matched.

- (1)
- j = $\langle \frac{-2y}{3}\rangle $ = 0
- (2)
- i =$\frac{x\sqrt{3}}{3}+y+j$$\approx $0.433 + 0.25 + 0 = 0.683
- (3)
- k =$i-\frac{2x}{\sqrt{3}}$$\approx $0.683 − 0.866 = −0.183

**Example**

**5.**(Point in Area C)

- (a)
- Converting from the Continuous Coordinate System to CCS.

- Step 1
- It belongs to the first quarter.
- Step 2
- It belongs to rectangle CB.
- Step 3
- Area C is matched.

- (1)
- k =$\langle \frac{y}{3}\rangle -\langle \frac{x}{\sqrt{3}}\rangle $= 0 − 0 = 0
- (2)
- i =$\frac{2x}{\sqrt{3}}+k$$\approx $0.346 + 0 = 0.346
- (3)
- j =$\frac{i+k}{2}-y$$\approx $0.173 − 0.799 = −0.626

**Example**

**6.**(A mid-point)

- (a)
- Converting from Continuous Coordinate System to CCS.

- Step 1
- It belongs to the first quarter.
- Step 2
- Based on Code 2, it belongs to rectangle CB (but, since it is a mid-point, then either rectangle AB or CB may be used).
- Step 3
- Area B is matched.

- (1)
- j =$\langle \frac{-2y}{3}\rangle $= 0
- (2)
- i =$\frac{x\sqrt{3}}{3}+y+j$= 0.5 + 0.5 + 0 = 1
- (3)
- k =$i-\frac{2x}{\sqrt{3}}$= 1 − 1 = 0

## 4. Properties of the Continuous Triangular Coordinate System

#### 4.1. On the Triplets of a General Point

^{(+)}and a

^{(−)}, in the green area. Then, the sum of the coordinate values of the points on this line would change continuously from 1 until −1. Depending on the sum, we can classify the points as follows:

- equal to 1, then it indicates the positive midpoint (i.e., a
^{(+)}); - equal to −1, then it indicates the negative midpoint (i.e., a
^{(−)}); - equal to 0, then it indicates the point on the triangle’s edge;
- positive, then the point belongs to the positive triangle;
- negative, then the point belongs to the negative triangle.

**Theorem**

**1.**

**Proof.**

_{1}, a

_{2}, a

_{3}), b = (b

_{1}, b

_{2}, b

_{3}), and c = (c

_{1}, c

_{2}, c

_{3}), where b and c are vertices (corners of an equilateral triangle) of the grid, while a is the midpoint of a positive triangle and p = (p

_{1}, p

_{2}, p

_{3}) is a randomly chosen point belonging to this area (inside or on the border of A). Now based on the barycentric Equation (1), we have the following.

**Theorem**

**2.**

**Proof.**

**Theorem**

**3.**

**Proof.**

_{1}, a

_{2}, a

_{3}), b = (b

_{1}, b

_{2}, b

_{3}), and c = (c

_{1}, c

_{2}, c

_{3}), where b and c are vertices (corners of an equilateral triangle) of the grid, while a is the midpoint and p = (p

_{1}, p

_{2}, p

_{3}) is a randomly chosen point belonging to this area (i.e., inside or on the border of the triangle abc). Since it is area A, we have a

_{1}= b

_{1}= c

_{1}. Substituting this into Equation (1), p

_{1}= a

_{1}follows for any point p in this area. A similar proof can be considered for areas B and C. □

#### 4.2. Relation to Discrete Coordinate Systems

^{3}and because of its symmetry. The triangular grid (nodes of the hexagonal grid) is called a two-plane triangular grid. Combining one-plane and two-plane grids produces the so-called three-plane triangular grid, which is known as the tri-hexagonal grid (Reference [24], Figure 2). In this subsection, their coordinate systems are compared to the new coordinate system.

**Theorem**

**4.**

**Proof.**

**Theorem**

**5.**

**Proof.**

**Theorem**

**6.**

**Proof.**

## 5. Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Coxeter, H.S.M. Introduction to Geometry, 2nd ed.; Wiley: New York, NY, USA, 1969. [Google Scholar]
- Middleton, L.; Sivaswamy, J. Hexagonal Image Processing—A Practical Approach; Springer: London, UK, 2005. [Google Scholar]
- Carr, D.B.; Olsen, A.R.; White, D. Hexagon mosaic maps for display of univariate and bivariate geographical data. Cartogr. Geograph. Inform. Syst.
**1992**, 19, 228–236. [Google Scholar] [CrossRef] - Sahr, K. Hexagonal discrete global grid systems for geospatial computing. Arch. Photogramm. Cartogr. Remote Sens.
**2011**, 22, 363–376. [Google Scholar] - Sakai, K.I. Studies on the competition in plants. VII. Effect on competition of a varying number of competing and non-competing individuals. J. Genet.
**1957**, 55, 227–234. [Google Scholar] [CrossRef] - Birch, C.P.; Oom, S.P.; Beecham, J.A. Rectangular and hexagonal grids used for observation, experiment and simulation in ecology. Ecol. Model.
**2007**, 206, 347–359. [Google Scholar] [CrossRef] - Her, I. A symmetrical coordinate frame on the hexagonal grid for computer graphics and vision. J. Mech. ASME
**1993**, 115, 447–449. [Google Scholar] [CrossRef] - Her, I. Geometric Transformations on the Hexagonal Grid. IEEE Trans. Image Proc.
**1995**, 4, 1213–1222. [Google Scholar] [CrossRef] [PubMed] - Luczak, E.; Rosenfeld, A. Distance on a hexagonal grid. IEEE Trans. Comput.
**1976**, 532–533. [Google Scholar] [CrossRef] - Almansa, A. Sampling, Interpolation and Detection. Applications in Satellite Imaging. Ph.D. Thesis, École Normale Supérieure de Cachan-ENS Cachan, Cachan, France, 2002. [Google Scholar]
- Pluta, K.; Romon, P.; Kenmochi, Y.; Passat, N. Honeycomb geometry: Rigid motions on the hexagonal grid. In Proceedings of the International Conference on Discrete Geometry for Computer Imagery, Vienna, Austria, 19 September 2017; Springer: Cham, Switzerland, 2017. LNCS. Volume 10502, pp. 33–45. [Google Scholar]
- Nagy, B. Isometric transformations of the dual of the hexagonal lattice. In Proceedings of the 6th International Symposium on Image and Signal Processing and Analysis, Salzburg, Austria, 16–18 September 2009; pp. 432–437. [Google Scholar]
- Deutsch, E.S. Thinning algorithms on rectangular, hexagonal and triangular arrays. Commun. ACM
**1972**, 15, 827–837. [Google Scholar] [CrossRef] - Bays, C. Cellular automata in the triangular tessellation. Complex Syst.
**1994**, 8, 127. [Google Scholar] - Nagy, B. Finding shortest path with neighbourhood sequences in triangular grids. In Proceedings of the 2nd International Symposium, in Image and Signal Processing and Analysis, Pula, Croatia, 19–21 June 2001; pp. 55–60. [Google Scholar]
- Nagy, B. A symmetric coordinate frame for hexagonal networks. In Proceedings of the ACM Theoretical Computer Science-Information Society, Ljubljana, Slovenia, 11–15 October 2004; Volume 4, pp. 193–196. [Google Scholar]
- Nagy, B. Cellular topology and topological coordinate systems on the hexagonal and on the triangular grids. Ann. Math. Artif. Intel.
**2015**, 75, 117–134. [Google Scholar] [CrossRef] - Nagy, B.; Lukic, T. Dense Projection Tomography on the Triangular Tiling. Fundam. Inform.
**2016**, 145, 125–141. [Google Scholar] [CrossRef] - Nagy, B.; Valentina, E. Memetic algorithms for reconstruction of binary images on triangular grids with 3 and 6 projections. Appl. Soft Comput.
**2017**, 52, 549–565. [Google Scholar] [CrossRef] - Kardos, P.; Palágyi, K. Topology preservation on the triangular grid. Ann. Math. Artif. Intell.
**2015**, 75, 53–68. [Google Scholar] [CrossRef] - Abdalla, M.; Nagy, B. Dilation and Erosion on the Triangular Tessellation: An Independent Approach. IEEE Access
**2018**, 6, 23108–23119. [Google Scholar] [CrossRef] - Nagy, B. Generalized triangular grids in digital geometry. Acta Math. Acad. Paedagog. Nyházi
**2004**, 20, 63–78. [Google Scholar] - Skala, V. Barycentric coordinates computation in homogeneous coordinates. Comput. Graph.
**2008**, 32, 120–127. [Google Scholar] [CrossRef] - Kovács, G.; Nagy, B.; Vizvári, B. Weighted Distances on the Trihexagonal Grid. In Proceedings of the International Conference on the Discrete Geometry for Computer Imagery, Vienna, Austria, 19 September 2017; Springer: Cham, Switzerland, 2017. LNCS. Volume 10502, pp. 82–93. [Google Scholar]
- Abuhmaidan, K.; Nagy, B. Non-bijective translations on the triangular plane. In Proceedings of the 2018 IEEE 16th World Symposium on Applied Machine Intelligence and Informatics (SAMI), Kosice, Slovakia, 7–10 February 2018; pp. 183–188. [Google Scholar]

**Figure 1.**The coordinate system for the hexagonal grid (

**a**) and its dual (

**b**). The coordinate system for the triangular grid (

**c**) and its dual (

**d**).

**Figure 2.**Representation of the tri-hexagonal coordinate system (

**a**) and its dual (

**b**). The same coordinate system is used to address the pixels (

**a**) and the nodes of the dual grid (

**b**).

**Figure 3.**The coordinate system for the tri-hexagonal grid is used for the triangular grid (and for its dual at the same time).

**Figure 4.**A composition of the barycentric technique and discrete coordinate system to address points p and q in the triangular plane by coordinate triplets in (

**a**) and (

**b**), respectively.

**Figure 5.**Dividing positive (

**a**) and negative (

**b**) triangles to three areas A, B, and C. The letters assigned to the isosceles triangles are based on the orientation of the sides.

**Figure 6.**(

**a**) By using either a

^{(+)}or a

^{(−)}, the whole green area A could be addressed. (

**b**) The hexagon surrounded by the thick dark blue line shows the entire area that can be addressed by using a positive midpoint m.

**Figure 7.**Proving how point p can be calculated by either the positive or negative midpoint (a

^{(+)}or a

^{(−)}). (

**a**) Shows the position of point p with respect to both a positive and a negative triangle, while (

**b**) and (

**c**) represent the calculation of the coordinates of point p based on the positive and negative triangles, respectively.

**Figure 8.**(

**a**) Re-structuring the triangular plane to fit the Cartesian plane. (

**b**) The two distinguished rectangles of the plane.

**Figure 10.**The red point is used to compute the value of r

_{1}, which is the Y-axis intercept with Line 1.

**Table 1.**The coordinate triplets formulae, based on area type, where $\langle \dots \rangle $ is a rounding operation *.

Coordinate Triplet | Area A | Area B | Area C |
---|---|---|---|

i | $\langle \frac{x}{\sqrt{3}}\rangle +\langle \frac{y}{3}\rangle $ | $\frac{x\sqrt{3}}{3}+y+j$ | $\frac{2x}{\sqrt{3}}+k$ |

j | $\frac{i+k}{2}-y$ | $\langle \frac{-2y}{3}\rangle $ | $\frac{i+k}{2}-y$ |

k | $i-\frac{2x}{\sqrt{3}}$ | $i-\frac{2x}{\sqrt{3}}$ | $\langle \frac{y}{3}\rangle -\langle \frac{x}{\sqrt{3}}\rangle $ |

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Nagy, B.; Abuhmaidan, K.
A Continuous Coordinate System for the Plane by Triangular Symmetry. *Symmetry* **2019**, *11*, 191.
https://doi.org/10.3390/sym11020191

**AMA Style**

Nagy B, Abuhmaidan K.
A Continuous Coordinate System for the Plane by Triangular Symmetry. *Symmetry*. 2019; 11(2):191.
https://doi.org/10.3390/sym11020191

**Chicago/Turabian Style**

Nagy, Benedek, and Khaled Abuhmaidan.
2019. "A Continuous Coordinate System for the Plane by Triangular Symmetry" *Symmetry* 11, no. 2: 191.
https://doi.org/10.3390/sym11020191