| Literature DB >> 33804720 |
Khaled Abuhmaidan1, Monther Aldwairi2, Benedek Nagy3.
Abstract
Vector arithmetic is a base of (coordinate) geometry, physics and various other disciplines. The usual method is based on Cartesian coordinate-system which fits both to continuous plane/space and digital rectangular-grids. The triangular grid is also regular, but it is not a point lattice: it is not closed under vector-addition, which gives a challenge. The points of the triangular grid are represented by zero-sum and one-sum coordinate-triplets keeping the symmetry of the grid and reflecting the orientations of the triangles. This system is expanded to the plane using restrictions like, at least one of the coordinates is an integer and the sum of the three coordinates is in the interval [-1,1]. However, the vector arithmetic is still not straightforward; by purely adding two such vectors the result may not fulfill the above conditions. On the other hand, for various applications of digital grids, e.g., in image processing, cartography and physical simulations, one needs to do vector arithmetic. In this paper, we provide formulae that give the sum, difference and scalar product of vectors of the continuous coordinate system. Our work is essential for applications, e.g., to compute discrete rotations or interpolations of images on the triangular grid.Entities:
Keywords: coordinate systems; digital geometry; discretized translations; nonlinearity; nontraditional grid; triangular grid; triangular symmetry; vector addition; vector arithmetic
Year: 2021 PMID: 33804720 PMCID: PMC8004019 DOI: 10.3390/e23030373
Source DB: PubMed Journal: Entropy (Basel) ISSN: 1099-4300 Impact factor: 2.524
Figure 1The three regular grids: the square, the hexagonal and the triangular grids and their grid points (midpoints of the pixels).
Figure 2(a) The discrete symmetric coordinate system for the hexagonal and (b) for the triangular grids. The coordinate values can also be considered to be assigned the midpoints of the corresponding pixels.
Figure 3Any grid-vector of specific length and direction will lead to a grid-point in the square and the hexagonal grids but not in the triangular grid.
Figure 4The symmetric coordinate system for the trihexagonal grid can also be used for the triangular grid and also for its dual, for the hexagonal grid, at the same time.
Figure 5(a,b): Dividing each triangle to three areas—A, B and C. The letters assigned to the isosceles triangles are based on the orientation of sides. (c): The areas actually rhombuses in the plane.
Figure 6A composition of the barycentric technique and discrete coordinate system to address points p and q in the triangular plane by coordinate triplets in (a,b), respectively.
Figure 7Addressing the points in a hexagon containing one area of each type, where the midpoint (m) of the hexagon has coordinates (i, j, k) and 0 ≤ u ≤ 1 and 0 ≤ v ≤ 1 in each area.
Figure 8The corresponding constant coordinate value for each area.
Figure 9The plane is tessellated by three types of rhombuses; it can also be seen as the surface of a mesh of the cubic grid having three faces of each cube on the surface.
Formulae for the coordinate triplets based on the type of the area. The operation 〈…〉 is a rounding operation *.
| Area A | Area B | Area C | |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Rounding operation returns the nearest integer to the real number, such that numbers exactly the same distance from two integers are rounded to the larger absolute valued one, e.g., , and .
Figure 10(a) Consider vectors v1 = (0.387, −1, 0.213) and v2 = (0.677, 0, −0.477); both are Type B. In this case, the direct-sum of vectors will be s = (1.064, −1, −0.264), which is Type B as well and hence is a result-vector for Ω. (b) Consider vectors v1 = (0.173, −0.813, 0) and v2 = (0.677, 0, −0.477) of Types C and B, respectively. In this case, the direct-sum of vectors will be s = (0.851, −0.813, −0.477), which is not compatible with Ω showing the nonlinearity of the system.
Figure 11(a) The six regions of the triangular plane. (b) The signs of the coordinate triplet for each region of the triangular plane.
Different samples to demonstrate the first step of the procedure (boldface coordinate values produce carry values).
| Sample (a) | Sample (b) | Sample (c) | Sample (d) | Sample (e) | |
|---|---|---|---|---|---|
| (1.0, | (1.0, | (1.0,−0.6, −0.1) | (1.0,−0.9, | (1.0,−0.9,−0.4) | |
| (1.0, | (1.0, | (1.0,−0.2,−0.7) | (1.9,−1.0, | (1.9,−1.0,−0.5) | |
| (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) | |
|
| 2, −2, −1 | 2, −2, −2 | 2, −1, −1 | 3, −2, −2 | 3, −2, −1 |
|
|
|
|
|
| |
| (+, −, −) | (+, −, −) | (+, −, −) | (+, −, −) | (+, −, −) |
All conditions and rules for specifying the type of result-vector.
|
|
|
| (−, −, + ) | IF ( |
| IF ( | |
| IF ( | |
| (−, +, + ) | IF ( |
| IF ( | |
| IF ( | |
| (+, −, −) | IF ( |
| IF ( | |
| IF ( | |
|
|
|
| (−, +, + ) | IF ( |
| IF ( | |
| IF ( | |
| (+, −, + ) | IF ( |
| IF ( | |
| IF ( | |
| (−, +, −) | IF ( |
| IF ( | |
| IF ( | |
|
|
|
| (−, +, + ) | IF ( |
| IF ( | |
| IF ( | |
| (−, −, + ) | IF ( |
| IF ( | |
| IF ( | |
| (+, +, −) | IF ( |
| IF ( | |
| IF ( | |
|
|
|
| (−, −, + ) | IF ( |
| (+, −, + ) | IF ( |
* if {}, {} or {} is the minimum (maximum, resp.) then the result-vector type is A, B or C respectively. If any two or three values of {}, {} and {}, are equal then the result-vector would be on a border or on a vertex which means selecting any type of them would be correct.
The full procedure to compute the result-vector with different samples. (boldface coordinate values produce carry values).
| Sample (a) | Sample (b) | Sample (c) | |
|---|---|---|---|
| (1.577, | (1.155, −1.423, | ( | |
| (1.005, | (0.808, | ( | |
|
| |||
|
| (2.582, −2.0, −0.882) | (1.963, −1.423, −0.808) | (2.0, −1.701, −1.002) |
|
| 3 + (−2) + (−1) = | 2 + (−2) + (−1) = | 2 + (−2) + (−2) = |
|
| (+, −, −) | (+, −, −) | (+, −, −) |
|
| |||
|
| If ( | If ( | If ( |
|
| − | Max ((0.963−1), −0.423, −0.808) = −0.037 = { | (−0.701) |
|
|
|
|
|
|
| |||
|
| ( | ( | ( |
|
| (2.582, | ( | (3.002, −0.699, |
|
| 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 |
|
| (2.582, | ( | (2.002, −1.699, |
Figure 12Examples for vector arithmetic: (a) Consider the scalar product of vector v = (0.5, 0, −0.25) with a positive integer multiplier n = 4 (that is to compute v + v + v + v) which yields to vector r = (2, 0, −1). (b) Consider the addition of vectors v1 = (0.75, 0, −0.25) and v2 = (−0.25, 0, 0.75) which results in vector r = (0, −0.5, 0). (c) The addition of the opposite vectors v1 = (1, 0, 0) and v2 = (−1, 0, 0) give vector r = (0, 0, 0).
Figure 13Example of image translation by vector addition: the points represented by vectors v1, …, v8 have been translated by vector k = (−0.848, −0.353, 1) to get the points represented by vectors u1, …, u8.
Figure 14Example for zooming an image by vector arithmetic: the star defined by points represented by vectors a1, …, j1 given in blue color are doubled and tripled, the resulted vectors and shapes are presented in red and green color.