Vector Arithmetic in the Triangular Grid
Abstract
:1. Introduction
2. Preliminaries
2.1. Vector Additions as Translations
2.2. Coordinate Systems for the Triangular Grid
 equal to 1, then it is the midpoint of a positive trixel;
 equal to −1, then it is a midpoint of a negative trixel;
 equal to 0, then the point is on the edge of a trixel;
 positive, then the point belongs to a positive trixel;
 negative, then the point belongs to a negative trixel.
2.3. Converting Triplets to Cartesian Coordinates and Vice Versa
3. Procedure for Adding Vectors in Ω
3.1. Further Definitions and Notations
 (1)
 $\u27e6x\u27e7$: The integer part of x with sign, i.e.;$\u27e6x\u27e7=sgn\left(x\right)\xb7\text{}\lfloor \leftx\right\rfloor \text{}=sgn\left(x\right)\langle \leftx\right\frac{1}{2}\rangle $, where$$sgn\left(x\right)=\text{}\{\begin{array}{c}+1,x0\\ 0,x=0\\ 1,x0\end{array}$$
 (2)
 {x}: The fractional part of x with sign, i.e.,$$\left\{x\right\}=x\u27e6x\u27e7$$
 (3)
 $\lfloor x\rceil $: The absoluteroundingup operation that rounds a number up in absolute value, such that:$$\lfloor x\rceil =\u27e6x\u27e7+\text{}sgn\left(\left\{x\right\}\right)=sgn\left(x\right)\langle \leftx\right\text{}+\text{}\frac{1}{2}\rangle .$$
 $\u27e61.3\u27e7$ = 1 and $\u27e61.3\u27e7$ = −1
 {1.3} = 0.3 and {−1.3} = − 0.3
 $\lfloor 1.3\rceil $ = 2 and $\lfloor 0.4\rceil $ = −1
 (1)
 $Rsum=\text{}\lfloor i\rceil \text{}+\text{}\lfloor j\rceil \text{}+\text{}\lfloor k\rceil $, where i, j, and k are the coordinate values of the directsum s.
 (2)
 The region is based on the signs of the coordinates of the directsum. Accordingly, the triangular grid is partitioned into six regions based on the signs of the coordinates of the triplet used in the region, as it is shown in Figure 11a,b. The region can be specified by checking the three coordinate values of s as follows. For each coordinate value, x, of the directsum vector, the sign is described as$$\mathrm{sign}\text{}\mathrm{of}\text{}x=\{\begin{array}{c}+,\mathrm{if}x0,\mathrm{or}x=0\mathrm{and}sum\le 0,\hfill \\ ,\mathrm{if}x0,\mathrm{or}x=0\mathrm{and}sum0,\hfill \end{array}$$
3.2. The Algorithm for the Computation
Procedure to find the resultvector r 
Input: v_{1} = (i_{1}, j_{1}, k_{1}) and v_{2} = (i_{2}, j_{2}, k_{2}), two vectors of Ω. Output: r = (i, j, k) = v_{1} + v_{2}, the resultvector in Ω. 
Step (1) Let: 
(a) directsum s: = (i, j, k) = (i_{1} + i_{2}, j_{1} + j_{2}, k_{1} + k_{2}) 
(b) $Rsum:=\text{}\lfloor i\rceil \text{}+\text{}\lfloor j\rceil \text{}+\text{}\lfloor k\rceil $ (c) Region: be the signs of the triplet of directsum. 
Step (2) Find the type of the resultvector (r): 


Step (3) Calculate the resultvector (r) by applying the following two steps: 


Else If ((i + j + k) < −2) Then, let r: = (i + 1, j + 1, k + 1). 
3.3. Step 1: Finding the DirectSum, Rsum, and the Region
3.4. Step 2: Finding the Type of the ResultVector
 If (adding vectors of types (A + A)) and (Rsum = −1)then the resultvector type is A.
 If (adding vectors of types (B + B)) and (Rsum = 0)then the resultvector type is B.
 If (adding vectors of types (C + C)) and (Rsum = 0)then the resultvector type is C.
3.5. Step 3: Finding Coordinate Triplet of the ResultVector
 If the type of the resultvector is A, then its coordinate triplet is:r = (i − ({i_{1}} + {i_{2}}), j − ({i_{1}} + {i_{2}}), k − ({i_{1}} + {i_{2}})),
 If the type of the resultvector is B, then its coordinate triplet is:r = (i − ({j_{1}} + {j_{2}}), j − ({j_{1}} + {j_{2}}), k − ({j_{1}} + {j_{2}})),
 If the type of the resultvector is C, then its coordinate triplet is:r = (i − ({k_{1}} + {k_{2}}), j − ({k_{1}} + {k_{2}}), k − ({k_{1}} + {k_{2}})),
 (1)
 j = $\text{}\langle \frac{2y}{3}\rangle $ = −2.0
 (2)
 i = $\frac{x\sqrt{3}}{3}\text{}+\text{}y\text{}+\text{}j$ = $\sqrt{3}$ + 2.85 − 2.0 = 2.582
 (3)
 k = $i\frac{2x}{\sqrt{3}}$ = 2.582 − 3.464 = −0.882
4. Vector Arithmetic and its Application
4.1. Subtraction and Scalar Product
 Input: v = (i, j, k) and integer n.
 Output: r = (i_{r}, j_{r}, k_{r}) the scalar product of the number n and vector v.
 Step1) If n = 0 then let r: = (0,0,0). Stop.
 Step2) If n < 0 then let n: = − n and v: = − v.
 Step3) Let r: = v.
 Step4) If n = 1 then Stop.
 Step5) For h = 2 to n do
 Step6) Let r: = r + v.
 Step7) Endfor.
 Step8) Stop.
4.2. Application: Drawing and Imaging on a Cubic Mesh
5. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
Appendix A
 By our procedure, if Rsum = −1, then vector r is of Type A and since i is integer, in fact, it is r = s = (i, j, k). If Rsum = −1, then either ($\lfloor {u}_{1}+{u}_{2}\rceil =1$ and $\lfloor {v}_{1}+{v}_{2}\rceil =2$), or ($\lfloor {u}_{1}+{u}_{2}\rceil =2$ and $\lfloor {v}_{1}+{v}_{2}\rceil =1$). Equivalently, (${u}_{1}+{u}_{2}\le 1$ and ${v}_{1}+{v}_{2}1$) or (${u}_{1}+{u}_{2}1$ and ${v}_{1}+{v}_{2}\le 1$). In both cases, i + j + k = $i+{j}_{m1}+{j}_{m2}+{k}_{m1}+{k}_{m2}\left({u}_{1}+{u}_{2}\right)\left({v}_{1}+{v}_{2}\right)=2\left({u}_{1}+{u}_{2}\right)\left({v}_{1}+{v}_{2}\right)$, and thus 1 ≥ i + j + k ≥ −1 holds, thus no correction is needed. As this triplet is converted exactly to r’= $\left(\frac{\sqrt{3}\left(ik\right)}{2},\frac{i2j+k}{2}\right)$, this result matches, proving that our procedure gives the sum correctly in the case when the sum is also a Type A vector.To complete the proof of this subcase, we check also that the vector (i, j, k) is valid in Ω. Thus, let us prove this part by converting the Cartesian coordinates of r’ to the corresponding triplet coordinates. Let us compute the coordinate triplet r = (l, m, n) assigned to r’. From the first column of Table 1, the values of l, n and m, in this order can be determined. The first coordinate l = $\langle \frac{\sqrt{3}\left(ik\right)}{2\sqrt{3}}\rangle +\langle \frac{i2j+k}{6}\rangle $ = $\langle \frac{ik}{2}\rangle +\langle \frac{i2j+k}{6}\rangle $ = $\langle \frac{ik}{2}\rangle +\langle \frac{i+j+k}{6}\frac{j}{2}\rangle $. In the given region i is always a positive integer, while j and k have nonpositive values, moreover we can substitute them based on $j={j}_{m1}{u}_{1}+{j}_{m2}{u}_{2}$ and $k={k}_{m1}{v}_{1}+{k}_{m2}{v}_{2}$ by using the abbreviations ${j}_{m1}={j}_{m1}+{j}_{m2}$, ${k}_{m}={k}_{m1}+{k}_{m2}$, $u={u}_{1}+{u}_{2}$ and $v={v}_{1}+{v}_{2}$. Thus, we have l = $\langle \frac{i{k}_{m}+v}{2}\rangle +\langle \frac{i+{j}_{m}+{k}_{m}}{6}\frac{{j}_{m}}{2}+\frac{2uv}{6}\rangle $ = $\lfloor \frac{i{k}_{m}+v+1}{2}\rceil +\lfloor \frac{i+{j}_{m}+{k}_{m}}{6}\frac{{j}_{m}}{2}+\frac{2uv}{6}+\frac{1}{2}\rceil $ by taking into account the signs (both parts are nonnegative) and the meaning of the rounding bracket. We already know that $i+{j}_{m}+{k}_{m}=2$, therefore l = $\lfloor \frac{i{k}_{m}+v+1}{2}\rceil +\lfloor \frac{2}{6}+\frac{1}{2}\frac{{j}_{m}}{2}+\frac{2uv}{6}\rceil $ = $\lfloor \frac{i{k}_{m}+v+1}{2}\rceil +\lfloor \frac{5}{6}\frac{{j}_{m}}{2}+\frac{2uv}{6}\rceil $. Since the sum $i+{j}_{m}+{k}_{m}$ is even, maybe all of these integers are even or exactly two of them are odd. Further, since Rsum = − 1, either (2 > v ≥ 1 and 1 > u ≥ 0) or (1 > v ≥ 0 and 2 > u ≥ 1). Thus, based on these conditions there are the following eight cases:
 i is even, k_{m} is even, j_{m} is even, v ≥ 1 > u. Then, by taking out the integers from the floor function l = $\frac{i}{2}\frac{{k}_{m}}{2}+\lfloor \frac{v+1}{2}\rceil \frac{{j}_{m}}{2}+\lfloor \frac{5+2uv}{6}\rceil $. As 2 > v ≥ 1, $\lfloor \frac{v+1}{2}\rceil $ = 1, and with these conditions, 6 > $5+2uv$ ≥ 3, which implies $\lfloor \frac{5+2uv}{6}\rceil =0$. Therefore, the value of l = $\frac{i}{2}\frac{{k}_{m}}{2}\frac{{j}_{m}}{2}+1$. However, from $i+{j}_{m}+{k}_{m}=2$ it is clear that $i=2{j}_{m}{k}_{m}$, and thus, $\frac{i}{2}=1\frac{{k}_{m}}{2}\frac{{j}_{m}}{2}$. Consequently, in this case, l = i.
 i is even, k_{m} is even, j_{m} is even, u ≥ 1 > v. l = $\frac{i}{2}\frac{{k}_{m}}{2}+\lfloor \frac{v+1}{2}\rceil \frac{{j}_{m}}{2}+\lfloor \frac{5+2uv}{6}\rceil $, however, in this case, $\lfloor \frac{v+1}{2}\rceil $ = 0. Further, 9 > $5+2uv$ ≥ 6, which implies $\lfloor \frac{5+2uv}{6}\rceil =1$. Thus, l = $\frac{i}{2}\frac{{k}_{m}}{2}\frac{{j}_{m}}{2}+1$ = i, as in the previous case.
 i is even, k_{m} is odd, j_{m} is odd and v ≥ 1 > u. Then, l = $\frac{i}{2}\frac{{k}_{m}1}{2}+\lfloor \frac{v}{2}\rceil \frac{{j}_{m}1}{2}+\lfloor \frac{2+2uv}{6}\rceil $. In this case $\lfloor \frac{v}{2}\rceil =0$ and $\lfloor \frac{2+2uv}{6}\rceil =0$, and thus l = $\frac{i}{2}\frac{{k}_{m}1}{2}\frac{{j}_{m}1}{2}=\frac{i}{2}\frac{{k}_{m}}{2}\frac{{j}_{m}}{2}+1=i$ again.
 i is even, k_{m} is odd, j_{m} is odd and u ≥ 1 > v. Then, l = $\frac{i}{2}\frac{{k}_{m}}{2}+\frac{1}{2}+\lfloor \frac{v}{2}\rceil \frac{{j}_{m}}{2}+\frac{1}{2}+\lfloor \frac{2+2uv}{6}\rceil $. Again, $\lfloor \frac{v}{2}\rceil =0$ and $\lfloor \frac{2+2uv}{6}\rceil =0$, and thus l $=\frac{i}{2}\frac{{k}_{m}}{2}\frac{{j}_{m}}{2}+1=i$.
 i is odd, k_{m} is even, j_{m} is odd, v ≥ 1 > u. Then, by taking out the integers from the floor function, we get l = $\frac{i+1}{2}\frac{{k}_{m}}{2}+\lfloor \frac{v}{2}\rceil \frac{{j}_{m}}{2}+\frac{1}{2}+\lfloor \frac{2+2uv}{6}\rceil $. In this case, we have $\lfloor \frac{v}{2}\rceil =0$ and $\lfloor \frac{2+2uv}{6}\rceil =0$, and thus, l $=\frac{i}{2}\frac{{k}_{m}}{2}\frac{{j}_{m}}{2}+1=i$.
 i is odd, k_{m} is even, j_{m} is odd, u ≥ 1 > v. Again, l = $\frac{i+1}{2}\frac{{k}_{m}}{2}+\lfloor \frac{v}{2}\rceil \frac{{j}_{m}}{2}+\frac{1}{2}+\lfloor \frac{2+2uv}{6}\rceil $, where both $\lfloor \frac{v}{2}\rceil =0$ and $\lfloor \frac{2+2uv}{6}\rceil =0$, thus l = i.
 i is odd, k_{m} is odd, j_{m} is even, v ≥ 1 > u. l = $\frac{i{k}_{m}}{2}+\lfloor \frac{v+1}{2}\rceil \frac{{j}_{m}}{2}+\lfloor \frac{5+2uv}{6}\rceil $, in this case $\lfloor \frac{v+1}{2}\rceil =1$, but 6 > $5+2uv$ ≥ 3, which implies $\lfloor \frac{5+2uv}{6}\rceil =0$, thus l = $\frac{i}{2}\frac{{k}_{m}}{2}+1\frac{{j}_{m}}{2}$, that is l = i.
 i is odd, k_{m} is odd, j_{m} is even, u ≥ 1 > v. l = $\frac{i{k}_{m}}{2}+\lfloor \frac{v+1}{2}\rceil \frac{{j}_{m}}{2}+\lfloor \frac{5+2uv}{6}\rceil $, but now, $\lfloor \frac{v+1}{2}\rceil =0$ and 9 > $5+2uv$ ≥ 6 implies $\lfloor \frac{5+2uv}{6}\rceil =1$. Thus, l = $\frac{i}{2}\frac{{k}_{m}}{2}\frac{{j}_{m}}{2}+1$ = i, as in the previous cases.
 B.
 This case consists the cases where either Rsum = 0 and {$\overline{j}$} ≤ {$\overline{k}$} or Rsum = −2 and {$\overline{j}$} ≥ {$\overline{k}$}. The two subcases are analogous, we shell show only the latter one here. The condition Rsum = −2 implies that both u = u_{1} + u_{2} > 1 and v = v_{1} + v_{2} > 1. The condition {$\overline{j}$} ≥ {$\overline{k}$} is the same as {j} ≥ {$k$}, and in fact, since these values are negative, equivalent to u_{1} + u_{2} ≤ v_{1} + v_{2}., i.e., u ≤ v. The procedure produces a Type B vector r = (i + u_{1} + u_{2}, j + u_{1} + u_{2}, k + u_{1} + u_{2}). Remembering the notation j_{m} = ${j}_{m1}+{j}_{m2}$ and k_{m} = ${k}_{m1}+{k}_{m2}$ and knowing that j = j_{m} − u_{1} − u_{2}, this can be written as r = (i + u_{1} + u_{2}, j_{m}, k + u_{1} + u_{2}) = (i + u, j_{m}, k + u) = (i + u, j_{m}, k_{m} − v + u) with the integer coordinate j_{m}. Let us check the sum of these coordinates: i + u + j_{m} + k_{m} − v + u = i + j_{m} + k_{m} + 2u − v = 2 + 2u − v (using i + j_{m} + k_{m} = 2). In the studied case Rsum = −2 yielding that u, v > 1, thus it is larger than 2, we need to apply Step 3b of our procedure: by subtracting 1 from each coordinate, the procedure gives the resulted vector (i + u − 1, j_{m} − 1, k + u −1). Now, let us check if it is correct by computing the Cartesian coordinate pair corresponding to this triplet. $x=\frac{\sqrt{3}\left(i+{u}_{1}+{u}_{2}1k{u}_{1}{u}_{2}+1\right)}{2}=\frac{\sqrt{3}\left(ik\right)}{2}$ and $y=\frac{i+{u}_{1}+{u}_{2}12j2{u}_{1}2{u}_{2}+2+k+{u}_{1}+{u}_{2}1}{2}$ = $\frac{i2j+k}{2}$. Thus, exactly the vector r’= $\left(\frac{\sqrt{3}\left(ik\right)}{2},\frac{i2j+k}{2}\right)$ is obtained, the sum is correctly computed by our procedure. Now we are checking if the resulted triplet of r is a valid vector in Ω, by transforming r’ to coordinate triplet, let us say, (l, m, n) in Ω. In Area B, first coordinate m is computed (by Table 1), then l and n are determined. $m=\langle \frac{2y}{3}\rangle $, by substituting y we have $m=\langle \frac{2}{3}\xb7\frac{i2j+k}{2}\rangle =\langle \frac{2jik}{3}\rangle =\langle \frac{3j}{3}\frac{i+j+k}{3}\rangle $. Now, using the facts that $j={j}_{m}u$ and $k={k}_{m}v$, we get the formula $m=\langle {j}_{m}\frac{i+{j}_{m}+{k}_{m}+2uv}{3}\rangle $. Applying that $i+{j}_{m}+{k}_{m}=2$, $m=\langle {j}_{m}\frac{2+2uv}{3}\rangle =$ $\langle {j}_{m}\frac{2}{3}+\frac{v2u}{3}\rangle =\langle {j}_{m}+\frac{v2u2}{3}\rangle $ is obtained. In this case, however, 1 < u ≤ v, but none of them is larger than 2, which implies that −2 < v − 2u < 0, thus $\frac{4}{3}<\frac{v2u2}{3}<\frac{2}{3}$ and this by the rounding operator, clearly implies that $m={j}_{m}1$, which is exactly the same as the value that we have obtained by our procedure. Now, continuing with l = $\frac{x\sqrt{3}}{3}+y+m=\frac{\sqrt{3}\left(ik\right)}{2}\xb7\frac{\sqrt{3}}{3}+\frac{i2j+k}{2}+{j}_{m}1=\frac{\left(ik\right)}{2}+\frac{i2j+k}{2}+j+u1=i+u1$, the same value is obtained as the one our procedure gave. Further, we compute $=l\frac{2x}{\sqrt{3}}=i+u1\frac{2}{\sqrt{3}}\xb7\frac{\sqrt{3}\left(ik\right)}{2}=$ $i+u1\left(ik\right)=k+u1$, which is also matching to the result of our procedure by proving this subcase: r = (i_{3}, j_{3}, k_{3}) = (l, m, n) = (i + u − 1, j + u − 1, k + u − 1). (The other subcase with the conditions Rsum = 0 and {$\overline{j}$} ≤ {$\overline{k}$} can be proven in a similar way.)
 C.
 Finally, the last case consists of the cases in which either Rsum = 0 and {$\overline{j}$} > {$\overline{k}$} or Rsum = −2 and {$\overline{j}$} < {$\overline{k}$}. In this case, our procedure gives a vector of Type C in an analogous way as we have discussed the previous cases.
References
 Coxeter, H.S.M. Introduction to Geometry, 2nd ed.; Wiley: New York, NY, USA, 1969. [Google Scholar]
 Klette, R.; Rosenfeld, A. Digital geometry: Geometric methods for digital picture analysis. In Morgan Kaufmann; Elsevier: San Francisco, CA, USA, 2004; Volume I–XVIII, pp. 1–656. ISBN 9781558608610. [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 noncompeting 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]
 Almansa, A. Sampling, Interpolation and Detection. Applications in Satellite Imaging. Ph.D. Thesis, École Normale Supérieure de CachanENS 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; LNCS. Springer: Cham, Switzerland, 2017; Volume 10502, pp. 33–45. [Google Scholar]
 Stojmenović, I. Honeycomb networks. In MFCS 1995: Mathematical Foundations of Computer Science; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1995; Volume 969, pp. 267–276. [Google Scholar]
 Stojmenović, I. Honeycomb Networks: Topological Properties and Communication Algorithms. IEEE Trans. Parallel Distrib. Syst. 1997, 8, 1036–1042. [Google Scholar] [CrossRef] [Green Version]
 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.; Abuhmaidan, K. A Continuous Coordinate System for the Plane by Triangular Symmetry. Symmetry 2019, 11, 191. [Google Scholar] [CrossRef] [Green Version]
 Abuhmaidan, K.; Nagy, B. Bijective, NonBijective and SemiBijective Translations on the Triangular Plane. Mathematics 2020, 8, 29. [Google Scholar] [CrossRef] [Green Version]
 Shao, Z.; Wu, P.; Zhu, E.; Chen, L. On Metric Dimension in Some Hex Derived Networks. Sensors 2019, 19, 94. [Google Scholar] [CrossRef] [PubMed] [Green Version]
 Leoni, F.; Shokef, Y. Attraction Controls the Entropy of Fluctuations in Isosceles Triangular Networks. Entropy 2018, 20, 122. [Google Scholar] [CrossRef] [PubMed] [Green Version]
 Gelincik, S.; RekayaBen Othman, G. DegreesOfFreedom in MultiCloud Based Sectored Cellular Networks. Entropy 2020, 22, 668. [Google Scholar] [CrossRef]
 Zhao, J.; Li, H.; Fang, Z.C.; Liu, Y. A mixed finite volume element method for timefractional reactiondiffusion equations on triangular grids. Mathematics 2019, 7, 600. [Google Scholar] [CrossRef] [Green Version]
 Zhao, J.; Fang, Z.; Li, H.; Liu, Y. A Crank—Nicolson Finite Volume Element Method for Time Fractional Sobolev Equations on Triangular Grids. Mathematics 2020, 8, 1591. [Google Scholar] [CrossRef]
 MejiaParra, D.; RuizSalguero, O.; Cadavid, C.; Moreno, A.; Posada, J. Level Sets of WeakMorse Functions for Triangular Mesh Slicing. Mathematics 2020, 8, 1624. [Google Scholar] [CrossRef]
 SegarraMartí, J.; RocaSanjuán, D.; Merchán, M. Can the Hexagonal Icelike Model Render the Spectroscopic Fingerprints of Structured Water? Feedback from QuantumChemical Computations. Entropy 2014, 16, 4101–4120. [Google Scholar] [CrossRef] [Green Version]
 Sharafullin, I.F.; Diep, H.T. Skyrmions and Spin Waves in Magneto−Ferroelectric Superlattices. Entropy 2020, 22, 862. [Google Scholar] [CrossRef] [PubMed]
 Grishina, V.; Vikhrenko, V.; Ciach, A. Structural and Thermodynamic Peculiarities of CoreShell Particles at Fluid Interfaces from Triangular Lattice Models. Entropy 2020, 22, 1215. [Google Scholar] [CrossRef]
 Li, S.; Li, W.; Lin, Z.; Yi, S. Method for 3D City Building Continuous Transformation Based on an Improved LOD Topological Data Structure. Isprs Int. J. GeoInf. 2019, 8, 504. [Google Scholar] [CrossRef] [Green Version]
 Deutsch, E.S. Thinning Algorithms on Rectangular, Hexagonal, and Triangular Arrays. Commun. Acm 1972, 15, 827–837. [Google Scholar] [CrossRef] [Green Version]
 Kardos, P.; Palágyi, K. Topology preservation on the triangular grid. Ann. Math. Artif. Intell. 2015, 75, 53–68. [Google Scholar] [CrossRef]
 Nagy, B.; Moisi, E.V. 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]
 MirMohammadSadeghi, H.; Nagy, B. On the chamfer polygons on the triangular grid. In International Workshop on Combinatorial Image Analysis; IWCIA 2017, Lecture Notes in Computer Science, LNCS; Springer: Berlin/Heidelberg, Germany, 2017; Volume 10256, pp. 53–65. [Google Scholar]
 MartínezGarcía, M.; Gordon, T. A new model of human steering using farpoint error perception and multiplicative control. In Proceedings of the IEEE International Conference on Systems, Man, and Cybernetics (SMC 2018), Miyazaki, Japan, 7–10 October 2018; pp. 1245–1250. [Google Scholar] [CrossRef]
 MartinezGarcia, M.; Zhang, Y.; Gordon, T. Memory Pattern Identification for Feedback Tracking Control in Human—Machine Systems. Hum. Factors 2021, 63, 210–226. [Google Scholar] [CrossRef] [PubMed] [Green Version]
 Pluta, K.; Romon, P.; Kenmochi, Y.; Passat, N. Bijective rigid motions of the 2D Cartesian grid. In DGCI 2016: Discrete Geometry for Computer Imagery; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2016; Volume 9647, pp. 359–371. [Google Scholar]
 Nouvel, B.; Rémila, E. Configurations induced by discrete rotations: Periodicity and quasiperiodicity properties. Discret. Appl. Math. 2005, 147, 325–343. [Google Scholar] [CrossRef] [Green Version]
 Pluta, K.; Romon, P.; Kenmochi, Y.; Passat, N. Bijective Digitized Rigid Motions on Subsets of the Plane. J. Math. Imaging Vis. 2017, 59, 84–105. [Google Scholar] [CrossRef]
 Nagy, B. Transformations of the triangular grid. In Proceedings of the GRAFGEO: Third Hungarian Conference on Computer Graphics and Geometry, Budapest, Hungary, 17–18 November 2005; pp. 155–162. [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]
 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]
 Avkan, A.; Nagy, B.; Saadetoglu, M. Digitized Rotations of 12 Neighbors on the Triangular Grid. Ann. Math. Artif. Intell. 2020, 88, 833–857. [Google Scholar] [CrossRef]
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 $ 
Sample (a)  Sample (b)  Sample (c)  Sample (d)  Sample (e)  

Vector1  (1.0,−0.6,−0.1)  (1.0,−0.6,−0.3)  (1.0,−0.6, −0.1)  (1.0,−0.9,−0.4)  (1.0,−0.9,−0.4) 
Vector2  (1.0,−0.9,−0.7)  (1.0,−0.9,−0.7)  (1.0,−0.2,−0.7)  (1.9,−1.0,−0.9)  (1.9,−1.0,−0.5) 
directsum  (2.0,−1.5,−0.8)  (2.0,−1.4,−1.09)  (2.0,−0.8,−0.8)  (2.9,−1.9,−1.3)  (2.9,−1.9,−0.9) 
$\lfloor \mathrm{i}\rceil ,\text{}\lfloor \mathrm{j}\rceil ,\lfloor \mathrm{k}\rceil $  2, −2, −1  2, −2, −2  2, −1, −1  3, −2, −2  3, −2, −1 
Rsum  −1  −2  0  −1  0 
Region  (+, −, −)  (+, −, −)  (+, −, −)  (+, −, −)  (+, −, −) 
Regions  Vectors of Type (A + A) 
(−, −, + ) (−, +, −) (+, −, + ) (+, +, −)  IF (Rsum = 0) THEN resultvector type is A 
IF (Rsum = 1) & ({$\overline{j}$}≤{$\overline{k}$}) THEN resultvector type is B ELSE C  
IF (Rsum = −1) & ({$\overline{j}$}≥{$\overline{k}$}) THEN resultvector type is B ELSE C  
(−, +, + )  IF (Rsum = 1) THEN resultvector type is A 
IF (Rsum = 0) & ({$\overline{j}$}≥{$\overline{k}$}) THEN resultvector type is B ELSE C  
IF (Rsum = 2) & ({$\overline{j}$}≤{$\overline{k}$}) THEN resultvector type is B ELSE C  
(+, −, −)  IF (Rsum = −1) THEN resultvector type is A 
IF (Rsum = 0) & ({$\overline{j}$}≤{$\overline{k}$}) THEN resultvector type is B ELSE C  
IF (Rsum = −2) & ({$\overline{j}$}≥{$\overline{k}$}) THEN resultvector type is B ELSE C  
Regions  Vectors of type (B + B) 
(−, +, + ) (−, −, + ) (+, −, −) (+, +, −)  IF (Rsum = 0) THEN resultvector type is B 
IF (Rsum = 1) & ({$\overline{i}$}≤{$\overline{k}$}) THEN resultvector type is A ELSE C  
IF (Rsum = −1) & ({$\overline{i}$}≥{$\overline{k}$}) THEN resultvector type is A ELSE C  
(+, −, + )  IF (Rsum = 1) THEN resultvector type is B 
IF (Rsum = 0) & ({$\overline{i}$}≥{$\overline{k}$}) THEN resultvector type is A ELSE C  
IF (Rsum = 2) & ({$\overline{i}$}≤{$\overline{k}$}) THEN resultvector type is A ELSE C  
(−, +, −)  IF (Rsum = −1) THEN resultvector type is B 
IF (Rsum = 0) & ({$\overline{i}$}≤{$\overline{k}$}) THEN resultvector type is A ELSE C  
IF (Rsum = 2) & ({$\overline{i}$}≥{$\overline{k}$}) THEN resultvector type is A ELSE C  
Regions  Vectors of type (C + C) 
(−, +, + ) (+, −, + ) (+, −, −) (−, +, −)  IF (Rsum = 0) THEN resultvector is of type C 
IF (Rsum = 1) & ({$\overline{i}$}≤{$\overline{j}$}) THEN resultvector is of type A ELSE B  
IF (Rsum = −1) & ({$\overline{i}$}≥{$\overline{j}$}) THEN resultvector is of type A ELSE B  
(−, −, + )  IF (Rsum = −1) THEN resultvector is of type C 
IF (Rsum = 0) & ({$\overline{i}$}≤{$\overline{j}$}) THEN resultvector is of type A ELSE B  
IF (Rsum = −2) & ({$\overline{i}$}≥{$\overline{j}$}) THEN resultvector is of type A ELSE B  
(+, +, −)  IF (Rsum = 1) THEN resultvector is of type C 
IF (Rsum = 0) & ({$\overline{i}$}≥{$\overline{j}$}) THEN resultvector is of type A ELSE B  
IF (Rsum = 2) & ({$\overline{i}$}≤{$\overline{j}$}) THEN resultvector is of type A ELSE B  
Regions  Vectors of type (A + B) or (A + C) or (B + C) 
(−, −, + ) (−, +, −) (+, −, −)  IF (Rsum = 0) THEN Min({$\overline{i}$},{$\overline{j}$},{$\overline{k}$}) is the resultvector type * IF (Rsum = −1) THEN Max({$\overline{i}$},{$\overline{j}$},{$\overline{k}$}) is the resultvector type * 
(+, −, + ) (+, +, −) (−, +, + )  IF (Rsum = 0) THEN Max({$\overline{i}$},{$\overline{j}$},{$\overline{k}$}) is the resultvector type * IF (Rsum = 1) THEN Min({$\overline{i}$},{$\overline{j}$},{$\overline{k}$})is the resultvector type * 
Sample (a)  Sample (b)  Sample (c)  

v_{1} = (i_{1}, j_{1}, k_{1})  (1.577, −2.0, 0.423)  (1.155, −1.423, 0.0)  (1.0, −0.735, −0.270) 
v_{2} = (i_{2}, j_{2}, k_{2})  (1.005, 0.0, −1.305)  (0.808, 0.0, −0.808)  (1.0, −0.966, −0.732) 
Step 1  
directsum  (2.582, −2.0, −0.882)  (1.963, −1.423, −0.808)  (2.0, −1.701, −1.002) 
Rsum  3 + (−2) + (−1) = 0  2 + (−2) + (−1) = −1  2 + (−2) + (−2) = −2 
Region  (+, −, −)  (+, −, −)  (+, −, −) 
Step 2  
Rule 1 and 2  If (Rsum = 0) Then B  If (Rsum = −1) Then Max({$\overline{i}$},{$\overline{j}$},{$\overline{k}$})  If (Rsum = −2) & ({$\overline{j}$} ≥ {$\overline{k}$}) Then B else C 
Apply Rule 1 and 2  −  Max ((0.963−1), −0.423, −0.808) = −0.037 = {$\overline{i}$}  (−0.701) $\ngtr $ (−0.002) 
Type of Resultvector  B  A  C 
Step 3  
a) s =  (i − ({j_{1}} + {j_{2}}, j − ({j_{1}} + {j_{2}}), k − ({j_{1}} + {j_{2}}) )  (i − ({i_{1}} + {i_{2}}), j − ({i_{1}} + {i_{2}}), k − ({i_{1}} + {i_{2}}) )  (i − ({k_{1}} + {k_{2}}), j − ({k_{1} } + {k_{2}}), k − ({k_{1}} + {k_{2}}) ) 
Apply a) s =  (2.582,−2.0,−0.882)  (1.0, −2.386, −1.771)  (3.002, −0.699, 0.0) 
b) Sum =  Sum = −0.3, then no need for addition or subtraction of 1  Sum = −3.157 < −2, then add 1 to each coordinate value  Sum = 2.303 > 2, then Subtract 1 from each coordinate value 
Resultvector  (2.582, −2.0, −0.882)  (2.0, −1.386, −0.771)  (2.002, −1.699, −1.0) 
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. 
© 2021 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
Abuhmaidan, K.; Aldwairi, M.; Nagy, B. Vector Arithmetic in the Triangular Grid. Entropy 2021, 23, 373. https://doi.org/10.3390/e23030373
Abuhmaidan K, Aldwairi M, Nagy B. Vector Arithmetic in the Triangular Grid. Entropy. 2021; 23(3):373. https://doi.org/10.3390/e23030373
Chicago/Turabian StyleAbuhmaidan, Khaled, Monther Aldwairi, and Benedek Nagy. 2021. "Vector Arithmetic in the Triangular Grid" Entropy 23, no. 3: 373. https://doi.org/10.3390/e23030373