Keywords

1 Introduction

Distance functions play important roles in several fields including theory in mathematics and geometry, and also, applications, e.g., engineering and various computing disciplines. The most usual distance function is the Euclidean distance and that is the base of Euclidean geometry. However, in image processing and computer graphics discrete space is preferred. In these spaces there are several phenomena which do not occur in the Euclidean plane, and vice versa. For instance, there is a point (moreover there are infinitely many distinct points) between any two distinct points of the Euclidean space. Opposite to this fact, there are neighbor points (pixels) in digital spaces, e.g., in regular grids. The points of a discrete grid having distance r from a given point of the grid (e.g., the Origin) do not form a circle (in the usual sense), but usually they form a small finite set that is not connected in any sense. Therefore, digital distances are of high importance; they are used in various applications instead of the Euclidean distance [7].

There are three regular tessellations of the plane: the square, the hexagonal and the triangular grids. The points of these regular grids can be addressed by integer coordinate values. In the square grid, the Cartesian coordinate system is used. The pixels of the hexagonal grid can be addressed with two integers [8], or with a more elegant solution, with three coordinate values whose sum is zero reflecting the symmetry of the grid [6, 9]. Similarly, in the triangular grid three coordinate values can effectively be used which are not independent [11, 12, 22]; and in this way easily captured the three types of neighborhood ([3], see also Fig. 1) in a mathematical way.

Digital distances are path-based and they are defined by connecting pixels/points by paths through neighbor pixels/points. The cityblock and the chessboard distances, the first two digital distances, are based on the number of steps connecting the points where 4-neighbor or 8-neighbor pixels are considered in each step on the square grid, respectively. Since they are very rough approximations of the Euclidean distance, the theory of digital distances are developed in various ways. In neighborhood sequences, the allowed steps may vary in a path [2, 15]. In weighted distances various neighbors have various weights, and the sum of the weights is used in the path. These distances are also called chamfer distances [21, 23]. These approaches could also be mixed, see, e.g., weight sequences in [20]. Another way to lower the rotational dependency of the digital distances is based on non-traditional grids. Both the hexagonal and the triangular grids have better symmetric properties than the square grid has: they have more symmetry axes and smaller rotations transform the grid to itself. Digital disks can be obtained by digitizing Euclidean circles [7, 14], they are the digitized circles and disks. Here, in this paper, we use the term digital disks for objects defined by digital distances. One of the goodness measures of digital distances, that is used in various applications, gives how good is the approximation of the Euclidean distance by them [1]. It can be done by measuring the compactness ratio of these polygons, i.e., digital disks obtained by digital distances. It is known that the (Euclidean) circles/disks are the most compact objects in the plane, their ratio, i.e., the perimeter square over the area, is \(4\pi \approx 12.566\), the smallest among all objects’. By measuring this value for the digital disks, the approximation of the Euclidean distance is measured. The most compactness of the circles can also be used to define another type of digital disks: the most compact grid objects try to inherit this characteristic property of the Euclidean circles/disks; they are characterized in [17, 18, 24] on various grids. Digital disks (spheres) are analyzed in [10] in nD rectangular grids based on weighted distances. The theory of distances based on neighborhood sequences on the triangular grid is also well developed [11, 12]. Digital circles/disks and their types are analyzed in [13] while the approximation of the Euclidean circles/distance is done in [19] using the dual grid notation. The weighted distances have been recently investigated on the triangular grid [16]. Here digital disks, and approximation of the Euclidean distance, are provided for various cases depending on the used weights.

2 Preliminaries

In this section the description of the triangular grid and the definition of weighted distances are given.

The triangular grid is a regular tessellation of the plane with same size regular triangles. Actually, it is not a lattice, since there are grid vectors that do not transform the grid to itself. This is due to the fact that there are two types of orientations of the triangles. The grid is described by three coordinate axes x, y, and z (see Fig. 1, right). In this paper we refer for the triangle pixels, as points, and usually, we will use their center, i.e., the dual, hexagonal grid notation. Each point of grid is described by a unique coordinate triplet using only integer values. However, the three values are not independent: the sum of coordinate values can be 0 (even point) or 1 (odd point). Each gridpoint is either even or odd, and these subsets of triangles have two different shapes \(\triangle \) and \(\nabla \), respectively. The vector through the mid-point of the edge to the opposite corner point is parallel/antiparallel with one of the axes (see also Fig. 1, right). Further we refer to the set of points of the triangular grid by \(\mathbb Z^3_*\) (\(\mathbb Z^3_* = \{(x,y,z) | x+y+z \in \{0,1\}\}\)).

Fig. 1.
figure 1

Type of neighbors (left); coordinate system for the triangular grid (right).

There are three different types of neighborhood on the triangular grid. (In the rectangular grid there are only two types of basic neighborhood.) Two distinct points (triangles) are 1-neighbors iff they have a side in common; they are strict 2-neighbors if there is a triangle which is 1-neighbor of both of them; further, the two points are strict 3-neighbors iff they share a corner, but they are not 1- and 2-neighbors. Two pixels are 2-neighbor if they are strict 2-neighbors or 1-neighbors, and two pixels are 3-neighbors if they are strict 3-neighbors or 2-neighbors. Formally: Let \(p=(p(1),p(2),p(3))\) and \(q=(q(1),q(2),q(3))\) be two points of \(\mathbb {Z}^3_*\), they are m-neighbors (\(m=1,2,3\)), if the following two conditions hold:

1. \(|p(i) - q(i)| \le 1\) for every \(i\in \{1,2,3\}\),

2. \(\sum \limits _{i=1}^3 |p(i) -q(i)| \le m\).

Equality in the second equation defines the strict m-neighborhood relation. In the following we describe some notations which are needed further. By \(\alpha \)-movement we denote a step from a point to one of its 1-neighbor; by \(\beta \)-movement a step to a strict 2-neighbor, and similarly by \(\gamma \)-movement a step to a strict 3-neighbor point. The strict 3-neighbor points of the Origin o is represented by \(o_x=(-1,1,1)\), \(o_y=(1,-1,1)\) and \(o_z=(1,1,-1)\). A lane is the set of points with one of the coordinate value fixed. We say that two lanes are parallel if the same coordinate is fixed, e.g., the lane \(\{p(p(1),0,p(3))\}\) is parallel to \(\{p(p(1),3,p(3))\}\); both of them are perpendicular to axis y. Let \(L_{x,-y}\) denote the half-lane \(\{p=(p(1),p(2),0)~|~p(2) \le 0 \}\), that is actually a half lane perpendicular to axis z (between the positive part of axis x and the negative part of axis y) starting from o. Let \(L_{y,-x} =\{p=(p(1),p(2),0)~|~p(1) \le 0 \}\) and similarly, for other four directions the half-lanes can be defined as \(L_{x,-z} =\{p=(p(1),0,p(3))~|~p(3) \le 0 \}\), \(L_{z,-x} =\{p=(p(1),0,p(3))~|~p(1) \le 0 \}\), \(L_{y,-z} =\{p=(0,p(2),p(3))~|~p(1) \le 0 \}\) and \(L_{z,-y} =\{p=(0,p(2),p(3))~|~p(2) \le 0 \}\). We can arrange these half-lanes into a cyclic list in positive direction (that is counterclockwise direction), and we can denote by \(\triangleright L_{i,-j}\) the next element of \(L_{i,-j}\) (\(i,j\in \{x,y,z\}\), \(i\ne j\)) in the cyclic list \(\left( L_{x,-y}, L_{z,-y}, L_{z,-x}, L_{y,-x}, L_{y,-z}, L_{x,-z} \right) \). Further, let p and q be two points in a common lane, then let \(L_{pq}\) be the set of points on this common lane between p to q. If p and q has a same parity, then let \(L^*_{pq} \subseteq L_{pq}\) be the subset having only points with the same parity as p (and q).

Let \(p=(p(1),p(2),p(3))\) and \(q=(q(1),q(2),q(3))\) be two 3-neighbor points, then the number of their coordinate differences gives the order of their strict neighborhood (as we have defined above). Weighted distances are path based distances, thus we need paths connecting the points. A path from p to q can be defined by a finite point sequence \(p=p_{0},...,p_{n}=q\) in which the points \(p_{i-1}\) and \(p_{i}\) are 3-neighbors for every \(1\le i\le n\). Thus this path can also be seen as sequence of n steps, such that in each step we move to a 3-neighbor point of the previous one. The weight of the path is equal to \(\alpha n_{1}+\beta n_{2}+\gamma n_{3}\), where \(n_{i}\) is the number of steps to strict i-neighbors in the path (\(n=n_1+n_2+n_3\)). There are several different paths from p to q with various weights. The weighted distance \(d(p,q;\alpha ,\beta ,\gamma )\) of p and q with weights \(\alpha , \beta , \gamma \) is the sum of weights of a/the minimal weighted path between p and q. In this paper, the natural condition of the weights, that is \(0< \alpha \le \beta \le \gamma \), used. There are various cases regarding the relative ratio of the weights (see [16]). Let the sidelength of the triangle pixels be 1 unit (in the Euclidean plane \(\mathbb R^2\)). By using the dual grid notation, i.e., the center of each triangle pixel instead of the pixel itself, a movement to a

  • 1-neighbor means a step by length \(\frac{\sqrt{3}}{3}\approx 0.57735\),

  • to a strict 2-neighbor means a step by length 1, and

  • to a strict 3-neighbor means a step by length \(\frac{2\sqrt{3}}{3}\approx 1.1547\).

Comparing it to the square grid a movement to a cityblock neighbor has length 1, while to a diagonal (that is a chessboard neighbor that is not a cityblock) neighbor has length \(\sqrt{2}\). One may observe that in the triangular grid, the step to a strict 3-neighbor has length twice than the length of a step to a 1-neighbor. In this paper, we do not allow paths which contain so large difference between some consecutive steps in a path. For this reason, we are working here all the possible cases introduced in [16], but those for which \(\gamma + \alpha <2\beta \) and thus, steps to 1-neighbors and strict 3-neighbors could alternate on some paths with minimal weights. In this way, at the considered cases, the shortest paths may contain steps to 2-neighbors (including 1-neighbors), or only steps to strict 2- and 3-neighbors. Since we work in the dual representation of the triangular grid, the elements of \(\mathbb {Z}^3_*\) will refer for the center points of the triangle pixels. In this way, we can easily define convex hull of any (finite) set D of grid points: let \(\bar{D}\subset \mathbb {R}^2\) be the convex polygon with smallest area such that each point of D is included in \(\bar{D}\). Formally:

                  \(\bar{D}=\left\{ \left. \sum \limits _{j=1}^n\lambda _jp_j~\right| ~\sum \limits _{j=1}^n\lambda _j, \lambda _j\ge 0\;\text {and}\;_j\in \bar{D}\right\} .\)

Further, the digital set \(D\subset \mathbb {Z}^3_*\) is (digitally) H-convex if \(D=\bar{D}\cap \mathbb {Z}^3_*\) [4, 7].

3 Digital Disks

In this section digital disks are described as convex hulls of the point sets reached with paths having weights at most a given value, called, radius. This way, the usage of dual representation of the triangular grid, i.e., the vertices of the hexagonal grid, allows us to compute standard geometric measures, such as the usual perimeter and area of these objects. Thus let us consider the centers of the pixels instead of them. Formally, let

                  \(D(o,r;\alpha ,\beta ,\gamma ) =\{p~|~d(o,p;\alpha ,\beta ,\gamma ) \le r\} ;\)

it is the digital disk defined by weights \(\alpha , \beta ,\gamma \) (with origin o) and radius r.

The weights \(\alpha \), \(\beta \) and \(\gamma \) can have various relations defining various cases. In different cases different paths become optimal, i.e., with minimum weight, and thus, the formula for the distance depends on the considered case [16]. The formulae for computing the weighted distance may depend not only on the weights, but on the type (parity) of the points.

Now, let \(\bar{D}(o,r;\alpha ,\beta ,\gamma )\) denote the convex hull of \(D(o,r;\alpha ,\beta ,\gamma )\) in \(\mathbb R^2\). Since various formulae are used for computing the distance d, convex hulls can be obtained in various shapes. Actually, the following conditions are fulfilled by the convex hulls of digital disks:

  • the weighted distance of the origin and the corners of the convex hull cannot be greater than our fixed radius r.

  • those points of \(D(o,r;\alpha ,\beta ,\gamma )\) are chosen to be corners that can make a maximum area of our convex hull with respect to the given radius r.

The relative values of the weights define various cases. In the following subsections we describe the shapes of the possible objects \(\bar{D}(o,r;\alpha ,\beta ,\gamma )\), and characterize them, by their side lengths l, perimeters P, areas A and their isoperimetric ratios \(\kappa \). The isoperimetric ratio is defined as \(\kappa =\frac{P^2}{A}\) which will be used to approximate the Euclidean circle.

Lemma 1

Let \(p \in L_{i,-j}\) and \(q\in \triangleright L_{i,-j}\) with \(d(o,p;\alpha ,\beta ,\gamma )=d(o,q;\alpha ,\beta ,\gamma )=n\alpha \) (for some \(n\in \mathbb N\), \(n\ge 2\)) having a shortest path between o and p (and between o and q, respectively) containing \(n \alpha -movements\), then there is a lane containing both p and q and that lane does not contain the point o. Moreover p and q have the same parity.

The proof of Lemma 1 goes in a combinatorial way by noticing that p and q have coordinates 0, \(-\lfloor {\frac{n}{2}}\rfloor \) and \(\lceil {\frac{n}{2}}\rceil \). By a similar technique one can also prove:

Lemma 2

Let \(p \in L_{i,-j}\) and \(q\in \triangleright L_{i,-j}\) such that one of the following conditions is fulfilled:

  1. (a)

    \(d(o,p;\alpha ,\beta ,\gamma )=d(o,q;\alpha ,\beta ,\gamma )=n\beta \) (for some \(n\in \mathbb N\), \(n\ge 2\)), and there is a shortest path between o and p containing n \(\beta \)-movements,

  2. (b)

    \(d(o,p;\alpha ,\beta ,\gamma )=d(o,q;\alpha ,\beta ,\gamma )=n\beta +\alpha \) (for some \(n\in \mathbb N, n\ge 2\)), and there is a shortest path between o and p containing an \(\alpha \)-movement and n \(\beta \)-movements,

  3. (c)

    \(d(o,p;\alpha ,\beta ,\gamma )=d(o,q;\alpha ,\beta ,\gamma )=n\beta \) such that there is a shortest path between o and p containing n \(\beta \)-movements, and there are \(p',q'\) strict 3-neighbor points of p and q, respectively, such that \(d(o,p';\alpha ,\beta ,\gamma )=d(o,q';\alpha ,\beta ,\gamma )=n\beta +\gamma \) having a shortest path between o and \(p'\) containing a \(\gamma \)- and n \(\beta \)-movements, (\(n\in \mathbb N, n\ge 1\)). Then there is a lane containing both p and q and that lane does not contain any of the points \(o, o_x,o_y,o_z \). Moreover p and q have the same parity.

By special equilateral triangles formed by pixels one can prove the forthcoming lemmas.

Lemma 3

Let \(p \in L_{i,-j}\) and \(q\in \triangleright L_{i,-j}\) such that \(d(o,p;\alpha ,\beta ,\gamma )=n\alpha =d(o,q;\alpha ,\beta ,\gamma )\) for a value \(n\in \mathbb N, n\ge 2\) and there is a shortest path between o and p containing only \(\alpha \)-movements; and let \(p'\in L^*_{pq}\). Then \(d(o,p';\alpha ,\beta ,\gamma )=n\alpha \).

Notice that \(L^*_{pq}\) may contain only the points p and q in case of \(n\in \{2,3\}\).

Lemma 4

Let \(p \in L_{i,-j}\) and \(q\in \triangleright L_{i,-j}\) and \(p'\in L^*_{pq}\) such that \(d(o,p;\alpha ,\beta ,\gamma )=d(o,q;\alpha ,\beta ,\gamma )=n\beta \), and there is a shortest path between o and p containing n \(\beta \)-movements, (\(n\in \mathbb N, n\ge 2\)). Then \(d(o,p';\alpha ,\beta ,\gamma )=d(o,p;\alpha ,\beta ,\gamma )\).

3.1 Case \(2\alpha \le \beta \) and \(3\alpha \le \gamma \)

In this case \(\alpha \)-movements are used.

Theorem 1

If \(2\alpha \le \beta \) and \(3\alpha \le \gamma \), then the convex hull of \(D(o,r;\alpha ,\beta ,\gamma )\) is H-convex and

(a) a point if \(r<\alpha \).

(b) a triangle if \(\alpha \le r< 2\alpha \).

(c) a hexagon if \(r\ge 2\alpha \).

Proof

The proof goes by the cases indicated in the theorem.

  1. (a)

    When \(r<\alpha \) the set \(D(o,r;\alpha ,\beta ,\gamma )\) contains only the Origin o, therefore its convex hull is also just a point and therefore, trivially H-convex.

  2. (b)

    When \(\alpha \le r< 2\alpha \) the set \(D(o,r;\alpha ,\beta ,\gamma )\) contains 4 points: (0, 0, 0), (1, 0, 0),  (0, 1, 0), (0, 0, 1). Its convex hull is a triangle (same size as the pixels of the grid), and it is straightforward to proof that it is H-convex. (See also Fig. 2(a).)

  3. (c)

    Let us see the case \(r\ge 2\alpha \): Under the condition of the theorem, the shortest weighted paths are built up by only \(\alpha \)-movements. The points that have maximal Euclidean distance from o among the points having at most distance r are on half-lanes \(L_{i,-j }\). Let \(p_{i,-j}\) represent the point on \(L_{i,-j}\) with this property. Let \(\triangleright p_{i,-j}\) represent the point on \(\triangleright L_{i,-j}\). Hence \(d(o,p_{i,-j};\alpha ,\beta ,\gamma )=n\alpha \) and by Lemma 1 \(p_{i,-j}\) and \(\triangleright p_{i,-j}\) are in the same lane. Moreover, by Lemma 3, all the points from \(L^*_{p_{i,-j} \triangleright p_{i,-j}}\) have digital distance of \(n\alpha \). It means that a point is a corner if and only if it is one of the points \(p_{i,-j}\) (\(i,j\in \{x,y,z\}\)) and, therefore, the shape of \(\bar{D}\) is a hexagon (see also Fig. 2(b and c)). Moreover, \(\bar{D}\) is H-convex, because it is shown that the points on the sides of \(\bar{D}\) have digital distance \(n\alpha \) from o and it is clear that the inner points have digital distance less than \(n\alpha \) and outer points have larger distance than \(n\alpha \).    \(\square \)

In the following subsections we compute some geometrical measures of the obtained disks (based on their convex hulls).

Subcase \(\varvec{\alpha \le r<2\alpha .}\) In this subcase \(r< 2\alpha \) and \(2\alpha < \beta \), therefore from the Origin one can move in exactly one step and exactly to those points which have a side in common and it cost \(\alpha \). The convex hull is a triangle with same area than a pixel has (see Fig. 2(a)). The length of the sides of the pixels is one unit. Consequently, the length of the sides for this convex hull is \(l=1\), the perimeter is \(P=3\), the area is \(A=\frac{\sqrt{3}}{4}\) and the isoperimetric ratio \(\kappa =\frac{36}{\sqrt{3}}\approx 20.78\).

Subcase \(\varvec{2n\alpha \le r<(2n+1)\alpha .}\) By considering a larger value of r, the convex hull be regular or almost regular hexagon. In this subcase, it forms a regular hexagon, where n is a natural number. Also n can be derived from the value of r: \(n=\lfloor \frac{r}{2\alpha }\rfloor \) with \(l=n\) (every 2 consecutive \(\alpha \)-movements correspond to distance of 1 unit), \(P=6n\), \(A=\frac{3\sqrt{3}}{2}n^2\), and \(\kappa =\frac{36}{\sqrt{3}}\approx 13.86\) (see Fig. 2(b)).

Fig. 2.
figure 2

(a) the convex hull of the digital disk in case \(2\alpha \le \beta \) and \(3\alpha \le \gamma \) with \(\alpha \le r<2\alpha \) is shown by pink color (the Origin as pixel is marked by black color). The same disk is obtained in case \(2\alpha >\beta \), \(\alpha +\beta \le \gamma \) with \(\alpha \le r<\beta \) and, also, in case \(2\alpha >\beta \), \(3\alpha >\gamma \), \(\alpha +\gamma >2\beta \), \(\alpha +\beta >\gamma \) with \(\alpha \le r<\beta \). (b and c) convex hulls of digital disks in case \(2\alpha \le \beta , 3\alpha \le \gamma \): (b) \(2\alpha \le r<3\alpha \), (c) \(8\alpha \le r<9\alpha \). (b and c) the same disks are obtained in case \(2\alpha >\beta , \alpha +\beta \le \gamma \): (b) \(\beta \le r<\alpha +\beta \), (c) \(4\beta \le r<\alpha +4\beta \) and (b and c) in case \(2\alpha >\beta \), \(3\alpha >\gamma \), \(\alpha +\gamma >2\beta \), \(\alpha +\beta >\gamma \): (b) \(\beta \le r<\gamma \), (c) \(4\beta \le r<3\beta +\gamma \). (d and e) Examples of digital disks in case \(2\alpha \le \beta ,3\alpha \le \gamma \): (d) \(3\alpha \le r<4\alpha \), (e) \(9\alpha \le r<10\alpha \). (d and e) Same disks are obtained in case \(2\alpha >\beta , \alpha +\beta \le \gamma \): (d) \(\alpha +\beta \le r<2\beta \), (e) \(\alpha +4\beta \le r<5\beta \) and, also, (d and e) in case \(2\alpha >\beta \), \(3\alpha>\gamma , \alpha +\gamma>2\beta , \alpha +\beta >\gamma \); (d) \(\alpha +\beta \le r<2\beta \), (e) \(\alpha +4\beta \le r<5\beta \) (Color figure online).

Subcase \(\varvec{(2n+1)\alpha \le r<2(n+1)\alpha .}\) In the third subcase we have \(n=\lfloor \frac{r-\alpha }{2\alpha }\rfloor \) and the convex hull is a non regular hexagon with sidelengths n and \(n+1\) (three sides with length n and the other three has length \(n+1\)). Further, \(P=6n+3\), \(A=(6n^2+6n+1)\frac{\sqrt{3}}{4}\), and the isoperimetric ratio is a function of n that is \(\kappa (n)=\frac{36(2n+1)^2}{\sqrt{3}(6n^2+6n+1)}\) (see Fig. 2(c)). As one may observe the hexagon is almost regular, in the sense that the difference of the length of sides is minimal in the grid (1 unit). Also, with larger and larger value of n it is closer and closer to the regular hexagon.

3.2 Case \(2\alpha >\beta \) and \(\alpha +\beta \le \gamma \)

Actually, in this case we unite two of the cases of [16]: The formulae for distance are very similar in case \((2\alpha >\beta , 3\alpha \le \gamma )\) and in case \((2\alpha>\beta , 3\alpha >\gamma ,\alpha +\beta \le \gamma )\). We have joined these cases with common condition: (\(2\alpha >\beta \) and \(\alpha +\beta \le \gamma \)).

Lemma 5

Let \(p \in L_{i,-j}\) and \(q\in \triangleright L_{i,-j}\) and \(p'\in L^*_{pq}\) such that \(d(o,p;\alpha ,\beta ,\gamma )=d(o,q;\alpha ,\beta ,\gamma )=n\beta +\alpha \), and there is a shortest path between o and p containing an \(\alpha \)-movement and n \(\beta \)-movements (\(n\in \mathbb N, n\ge 2\)). Then \(d(o,p';\alpha ,\beta ,\gamma )=d(o,p;\alpha ,\beta ,\gamma )\).

In these cases the obtained convex hulls form the same set by using identical intervals of the digital distance r. Here, again, there are three subcases, and the obtained convex hulls are the same as in the previous subsection.

In the case when \(r<\beta \), actually we have exactly the same digital distances, digital discs and convex hulls as in the previous subsection (Theorem 1, case \(r<2\alpha \)), and also for larger radii the disks obtained in this case are similar to the ones discussed earlier. Let us see how and why they are.

Theorem 2

If \(2\alpha > \beta \) and \(\alpha +\beta \le \gamma \), then the convex hull of \(D(o,r;\alpha ,\beta ,\gamma )\) is H-convex and

(a) a point if \(r<\alpha \).

(b) a triangle if \(\alpha \le r< \beta \).

(c) a regular hexagon if \(n\beta \le r< \alpha +n\beta \) (for \(n\in \mathbb N, n\ge 1\)).

(d) a non regular hexagon if \(\alpha +n\beta \le r< (n+1)\beta \) (for \(n\in \mathbb N, n\ge 1\)).

The proof is analogous to the proof of Theorem 1 applying Lemmas 2, 4 and 5.

Subcase \(\varvec{\alpha \le r<\beta .}\) The convex hull of this condition is an equilateral triangle with \(l=1\), \(P=3\), \(A=\frac{\sqrt{3}}{4}\) and \(\kappa =\frac{36}{\sqrt{3}}\) (see Fig. 2(a), also, but here, in this case, the condition \(\alpha \le r<\beta \) applies).

Subcase \(\varvec{n\beta \le r<\alpha +n\beta .}\) The convex hull is a regular hexagon and \(n=\lfloor \frac{d}{\beta }\rfloor \) with \(l=n\), \(P=6n\), \(A=\frac{3\sqrt{3}}{2}n^2\), and \(\kappa =\frac{36}{\sqrt{3}}\approx 13.86\) (See Fig. 2(b)).

Subcase \(\varvec{\alpha +n\beta \le r<(n+1)\beta .}\) The convex hull is an almost regular hexagon and \(n=\lfloor \frac{r-\alpha }{\beta }\rfloor \) with three sides with length n and three sides with length \(n+1\), \(P=6n+3\), \(A=(6n^2+6n+1)\frac{\sqrt{3}}{4}\), and \(\kappa (n)=\frac{36(2n+1)^2}{\sqrt{3}(6n^2+6n+1)}\) (see Fig. 2(c)).

3.3 Case \(2\alpha >\beta \) and \(\alpha +\gamma >2\beta \) but \(\alpha +\beta >\gamma \)

In this case steps to strict 3-neighbor may also occur in some shortest paths, and therefore we have a larger variety of cases.

Lemma 6

Let \(\alpha \), \(\beta \) and \(\gamma \) be given such that \(2\alpha >\beta \), \(\alpha +\gamma >2\beta \) and \(\alpha +\beta >\gamma \). Let \(p \in L_{i,-j}\) and \(q\in \triangleright L_{i,-j}\) and \(\triangleright L_{i,-j}=L_{k,-j}\) (where \(i,j,k\in \{x,y,z\}\) have distinct values) such that \(d(o,p;\alpha ,\beta ,\gamma )=d(o,q;\alpha ,\beta ,\gamma )=n\beta \) with a shortest path between o and p containing only \(\beta \)-movements; and there are \(p_1,q_1\) strict 3-neighbor points of p and q, respectively, such that \(d(o,p_1;\alpha ,\beta ,\gamma )=d(o,q_1;\alpha ,\beta ,\gamma )=n\beta +\gamma \) (\(n\in \mathbb N, n\ge 1\)) and there is a shortest path between o and \(p_1\) containing a \(\gamma \) and n \(\beta \)-movements. Further, let \(p'\in L^*_{p_1q_1}\). Then \(d(o,p';\alpha ,\beta ,\gamma )=d(o,p_1;\alpha ,\beta ,\gamma )\).

The next theorem can be proven using Lemmas 2(c), 4 and 6.

Theorem 3

If \(2\alpha >\beta \), and \(\alpha +\gamma >2\beta \) but \(\alpha +\beta >\gamma \), then the convex hull is H-convex and it is

(a) a point if \(\alpha > r\).

(b) an equilateral triangle, if \(\alpha \le r\le \beta \).

(c) a regular hexagon, if \(n\beta \le r <(n-1)\beta + \gamma \) (for \(n\in \mathbb N, n\ge 1\)).

(d) a non regular hexagon, if \(n\beta +\alpha \le r <(n+1)\beta \) (for \(n\in \mathbb N, n\ge 1\)).

(e) an enneagon, if \(\gamma \le r < \alpha +\beta \).

(f) a dodecagon, if \((n-1)\beta +\gamma \le r < \alpha + \)n\(\beta \) (for \(n\in \mathbb N, n\ge 2\)).

In the following subsections some geometric measures of the obtained disks are shown.

Subcase \(\varvec{\alpha \le r<\beta .}\) Again, one can see the triangle with \(l=1\), \(P=3\), \(A=\frac{\sqrt{3}}{4}\) and \(\kappa =\frac{36}{\sqrt{3}}\) (see Fig. 2(a)).

Subcase \(\varvec{n\beta \le r<(n-1)\beta +\gamma .}\) This convex hull, in this case, is a regular hexagon and \(n=\lfloor \frac{r}{\beta }\rfloor \). Consequently, \(l=n\), \(P=6n\), \(A=\frac{3\sqrt{3}}{2}n^2\), and \(\kappa =\frac{36}{\sqrt{3}}\approx 13.86\) (see Fig. 2(b and c)).

Subcase \(\varvec{(n-1)\beta +\gamma \le r<\alpha +n\beta .}\) In this special subcase \(n=\lfloor \frac{r+\beta -\gamma }{\beta }\rfloor \) and the convex hull is dodecagon if \(n>1\). In case of \(n=1\) three pairs of the corners of the dodecagon become identical and thus three of the sides has 0 length, hence forming an enneagon. Generally, for these polygons (an enneagon and the dodecagons) the side lengths are \({n-1,n,\frac{\sqrt{3}}{3}}\), \(P= 6n+2\sqrt{3}-3\), \(A=\frac{\sqrt{3}}{12}(18n^2+6n-3)\) and \(\kappa (n)=\frac{12(6n+2\sqrt{3}-3)^2}{\sqrt{3}(18n^2+6n-3)}\) (see Fig. 3).

Fig. 3.
figure 3

Digital disks in case \(2\alpha >\beta \) and \(3\alpha >\gamma \), \(\alpha +\gamma >2\beta \) but \(\alpha +\beta >\gamma \); (a) \(\gamma \le r<\alpha +\beta \), (b) \(\beta +\gamma \le r<\alpha +2\beta \), (c) \(3\beta +\gamma \le r<\alpha +4\beta \).

Fig. 4.
figure 4

(a) a non regular hexagon with \((\alpha ,\beta ,\gamma )=(1,3,4)\), \(n=19\), (b) dodecagon with \((\alpha ,\beta ,\gamma )=(3,4,5)\), \(n=8\)

Subcase \(\varvec{\alpha +n\beta \le r<(n+1)\beta .}\) In the last subcase we have non regular hexagons and \(n=\lfloor \frac{d-\alpha }{\beta }\rfloor \) with sidelength \({n,n+1}\), with \(P=6n+3\), \(A=(6n^2+6n+1)\frac{\sqrt{3}}{4}\), and \(\kappa (n)=\frac{36(2n+1)^2}{\sqrt{3}(6n^2+6n+1)}\) (see Fig. 2(c)).

4 Approximation of Euclidean Circles

There are plenty of ways to measure approximation quality of a digital disk, see, e.g. [5]. In this section based on the isoperimetric ratio we show best approximations of the Euclidean circles/disks. The approximations in the limit \(r\rightarrow \infty \) are also investigated. We also summarize the data about digital disks provided in the previous section in tables. These data are used to find optimal disks to provide the best approximation in each case and subcase. The isoperimetric ratio for any convex hull is greater than the isoperimetric ratio of the Euclidean circle which is \(4\pi \), because by using a fixed perimeter, the circle has the greatest area (and, also having a fixed area the circle has the lowest perimeter). Therefore, the smallest possible isoperimetric ratio gives the best approximation of the Euclidean disk.

Table 1. The side lengths l, the perimeter P and the area A at case \(2\alpha \le \beta \) and (\(3\alpha \le \gamma \) or \(\alpha +\beta \le \gamma \)). The isoperimetric ratio \(\kappa \) is also shown.
  • Case \(2\alpha \le \beta \) and \(3\alpha \le \gamma \) and Case \(2\alpha \le \beta \) and \(\alpha +\beta \le \gamma \):

    In this case Table 1 summarizes the data of the obtained convex hulls \(\bar{D}\). As one can see, \(\kappa \) is constant at the first two subcases (triangle and regular hexagon). At the third case, at non regular hexagons, it depends on n, and \(\kappa \) is decreasing with n having \(\lim _{n \rightarrow \infty }\kappa =\frac{24}{\sqrt{3}}\approx 13.86\) which is same as the isoperimetric ratio of the regular hexagon. These non regular hexagons look like a regular hexagon when n grows (see Fig. 4(a), for an example).

  • Case \(2\alpha >\beta \) and \(3\alpha >\gamma \), but \(\alpha +\beta >\gamma \):

    For this case three of the subcases are the same as the subcases of the previous case(s), see Table 2. However, there is a subcase that was not present in the other cases. In this subcase (line 3 of Table 2) \(\kappa (n)=\frac{12(6n+2\sqrt{3}-3)^2}{\sqrt{3}(18n^2+6n-3)}\). This function has two critical value: at \(n_1=\frac{1}{6}(3-2\sqrt{3})\approx -0.077\) and at \(n_2=\frac{-3-2\sqrt{3}}{12(-2+\sqrt{3})}\approx 2.01\). Since n is a non negative integer, its optimal value at \(n_2 \approx 2\) is considered. Consequently, \(\kappa (2)\approx 13.29\) is the minimum value of \(\kappa \), i.e., the best approximation of an Euclidean disk. The isoperimetric ratio as the function of n is strictly monotonously increasing from \(n_2\) to \(\infty \), and in \(\lim _{n\rightarrow \infty }k=\frac{24}{\sqrt{3}}\approx 13.86\): this dodecagon become similar to a regular hexagon in the limit \(n\rightarrow \infty \). See, also, Fig. 4(b) for an example.

Comparing all these cases and subcases, the best \(\kappa \) is found at case (\(2\alpha >\beta \) and \(3\alpha >\gamma \), but \(\alpha +\beta >\gamma \)) with the subcase of \((n-1)\beta +\gamma \le r<\alpha +n\beta \). Other cases/subcases result in triangles and hexagons.

Table 2. The side lengths l, the perimeter P, the area A and the isoperimetric ratio \(\kappa \) at case \(2\alpha >\beta \) and \(3\alpha >\gamma \), but \(\alpha +\beta >\gamma \).

5 Conclusions

Approximation of the Euclidean distance and circles are frequent topics of papers in digital geometry connected to image processing. The literature about weighted/chamfer distances is also rich. This concept has appeared recently on the triangular grid, as well. In this paper, we have continued the work on this field by providing characterization of digital disks for some of the possible cases and also showing best approximations of the Euclidean circle/disk in these cases.

We believe that to find an appropriate digital distance for a given application can be more easily if theoretical results for the digital distances are already provided. One of the criteria of the usage of some distance is their metric properties. In [16] it is proven that all our weighted distances are metrics. Another criteria could be the approximation of the Euclidean distance, results on this line of research are shown here.