Random Distances Associated with Arbitrary Polygons: An Algorithmic Approachbetween Two Random Points

Random Distances Associated with Arbitrary Polygons: An Algorithmic Approach
between Two Random Points

Fei Tong and Jianping Pan
University of Victoria, Victoria, BC, Canada
Abstract

This report presents a new, algorithmic approach to the distributions of the distance between two points distributed uniformly at random in various polygons, based on the extended Kinematic Measure (KM) from integral geometry. We first obtain such random Point Distance Distributions (PDDs) associated with arbitrary triangles (i.e., triangle-PDDs), including the PDD within a triangle, and that between two triangles sharing either a common side or a common vertex. For each case, we provide an algorithmic procedure showing the mathematical derivation process, based on which either the closed-form expressions or the algorithmic results can be obtained. The obtained triangle-PDDs can be utilized for modeling and analyzing the wireless communication networks associated with triangle geometries, such as sensor networks with triangle-shaped clusters and triangle-shaped cellular systems with highly directional antennas. Furthermore, based on the obtained triangle-PDDs, we then show how to obtain the PDDs associated with arbitrary polygons through the decomposition and recursion approach, since any polygons can be triangulated, and any geometry shapes can be approximated by polygons with a needed precision. Finally, we give the PDDs associated with ring geometries. The results shown in this report can enrich and expand the theory and application of the probabilistic distance models for the analysis of wireless communication networks.

{keywords}

Distance distributions; Kinematic Measure; triangles; polygons; ring geometries; wireless communication networks

I PDD within a Triangle

Fig. 1: KM over an arbitrary triangle.

is an arbitrary triangle with side lengths , , and , internal angles , , and , and area . Without loss of generality (WLOG), , and let side be on -axis, as shown in Fig. 1. For simplicity, we can have and other edges normalized correspondingly. The Probability Density Function (PDF) of the PDD, denoted as , can be scaled to any size of triangles with by

(1)

where is the corresponding PDF of the PDD within the triangle with . Such a scaling is applicable to any polygons. When calculating the length of the chord produced by a line intersecting with the triangle with orientation with regard to -axis, there are three cases in terms of the range of : (i) , (ii) , (iii) . We then design a systematic algorithmic procedure for the numerical integration of the intended PDD, based on which the corresponding closed-form expression is also derived, as shown below in detail.

 

0:  Parameters with regard to in Fig. 1.
0:  PDF: .
1:  ;
2:  for (; ; do
3:     if  then
4:        ; ; ;
5:     else if  then
6:        ; ; ;
7:     else if  then
8:        ; ; ;
9:     end if
10:     ; width
11:     for (; ; do
12:        if  then
13:           ;
14:        else
15:           ;
16:        end if
17:        if  then
18:           ;
19:        end if
20:     end for
21:  end for

 

Fig. 2: Algorithmic procedure for obtaining the PDD within an arbitrary triangle.

Specifically, let increase from to with a fixed small step of (e.g., ). For each with a set of lines intersecting with the triangle, is the line which produces the longest chord of length . The distance between the two tangents parallel with , i.e., the support lines and which completely encompass the whole triangle, is . The distance between and and that between and are and , respectively. Obviously, . With increasing from 0 to with a fixed small step (e.g., ), we obtain chords. For each chord of length calculated based on trigonometry, we obtain , based on which the PDF of the PDD can be calculated. The derivation is summarized in Fig. 2, providing the regularity to help obtain the PDF symbolically as and go to .

We investigate the case (i) where first, and show below how to obtain the corresponding closed-form expression based on the algorithmic procedure shown in Fig. 2. Specifically, for , a chord is determined by () with length of as shown in line 13 of Fig. 2. From (line 18 of Fig. 2), the integration range of is , and or . Meanwhile, for , the length of the determined chord is . Similarly, from , we have , and or . Therefore,

(2)

where

(3)
(4)

Similarly, for case (ii), we have

(5)

where

and for case (iii),

(6)

where

Finally, the PDF of the PDD within an arbitrary triangle is

(7)

Similar to and , and can be calculated using (3), and and can be calculated using (4), but with different , and for different cases (see line 39 of Fig. 2). , , , , , and in (7) are

where

Therefore, the closed-form expression of the PDF of PDD within an arbitrary triangle, i.e., (7), has been obtained.

Although the obtained closed-form expression looks tedious, note that, for the network performance analysis, we do not use the symbolic expression of (7) directly but the numerical PDF result calculated promptly by (7) providing the necessary parameters (e.g., two edges and one angle, or two angles and one edge) of an arbitrary triangle. Simulations can also be utilized for obtaining PDDs. However, conducting simulations for each specific triangle is very time-consuming, and requires a large number of runs to obtain statistically significant results. Moreover, by simulations, only the empirical Cumulative Distribution Function (CDF) of nodal distances can be obtained, while the accurate PDF is also indispensable to the modeling and analysis of wireless communication networks.

The obtained results are verified in comparison with simulation and the approach in [2] based on Chord Length Distribution (CLD). The simulation is conducted in Matlab as below (the following simulations are all conducted in a similar way):

(1)

Generate a point uniformly at random within a triangle.

(2)

Generate another point uniformly at random within the triangle.

(3)

Compute the Euclidean distance between these two points and append the obtained distance to a matrix.

(4)

Repeat steps (1)–(3) times (the more repeats, the more accurate the result). Then use the Matlab function “ecdf” with the matrix as its parameter, we can obtain the empirical CDF of the PDD within the triangle.

Fig. 3: PDDs within arbitrary triangles.

For simplicity, only numerical CDFs obtained by integrating the corresponding PDFs are shown here and hereafter. Three triangles are selected: [a] , [b] , and [c] , all of which have the longest side length of 1, which can be scaled to any nonzero size as introduced in (1). For the first triangle, i.e., an equilateral triangle (ET), the result is also compared with that obtained in [4], which is only applicable for ET. Figure 3 shows a close match between the obtained results based on KM and the simulation results.

Ii PDD between Two Triangles

Our approach can also be utilized to obtain the PDD between two disjoint geometries, with which the PDD-based performance metrics associated with two clusters in ad-hoc networks or two cells in cellular systems can be quantified. In this section, we show how to obtain the PDDs between two triangles sharing either a common side or a vertex. For the former, the two triangles can form either a convex or concave quadrangle, as shown in Fig. 4(a) and 4(b), respectively. For simplicity, hereafter, only the algorithmic procedure showing the derivation process is provided, based on which the closed-form expressions can be derived following the same method as shown in Section I.

(a) convex quadrangle
(b) concave quadrangle
Fig. 4: Two triangles sharing a common side form a quadrangle (, and ).
Fig. 5: KM over the convex quadrangle shown in Fig. 4(a) ().

Ii-a Two Triangles Share a Side, Forming a Convex Quadrangle

is a convex quadrangle formed by two arbitrary triangles, with and , and with and , as shown in Fig. 4(a). , , , and . WLOG, let be on the -axis. The relationship between and and that between and determine the shape of the quadrangle, leading to the following four cases:

Case [a] is the same as [d] if is on -axis after rotating the quadrangle. Similarly, case [b] and [c] are essentially the same. Different cases correspond to different ranges of the orientation angle . Below, we will use case [a] to show how to obtain the PDD between the two triangles.

 

0:  Parameters with regard to the convex quadrangle in Fig. 4(a).
0:  PDF: .
1:  ;
2:  for (; ; do
3:     if  then
4:        ;
5:     else if  then
6:        ;
7:     else if  then
8:        ;
9:     end if
10:     for (; ; do
11:        Calculate and for the line () according to trigonometry;
12:        ; ; /* */
13:        if  then
14:           ; ; /* */
15:        end if
16:        if  then
17:           ;
18:        else if  then
19:           ;
20:        else if  then
21:           ;
22:        end if
23:     end for
24:  end for

 

Fig. 6: Algorithmic procedure for the PDD between two triangles sharing a common side and forming a convex quadrangle.
Fig. 7: PDD between two triangles sharing a common side and forming a convex/concave quadrangle.

As shown in Fig. 5, for the convenience of calculation based on trigonometry, there are six subcases for case [a] in terms of the range of the line orientation with regard to -axis. For a given , only the lines intersecting with both triangles are considered, i.e., the parallel lines between and for subcase (i) and (iv), those between and for (ii) and (iii), and those between and for (v) and (vi). For each line, denote the length of the segment in as , and that in as ( in this case). The distances between and , and , and and are , , and , respectively. The complete derivation process is shown in Fig. 6. Figure 7 shows a close match with the simulation results, given the two triangles, and as an example, as shown in Fig. 4(a).

Ii-B Two Triangles Share a Side, Forming a Concave Quadrangle

Fig. 8: KM over the concave quadrangle shown in Fig. 4(b).

 

0:  Parameters with regard to the concave quadrangle in Fig. 4(b).
0:  PDF: .
1:  ;
2:  for (; ; do
3:     if  then
4:        ;
5:     else if  then
6:        ;
7:     end if
8:     for (; ; do
9:        Calculate , , and for the line () according to trigonometry;
10:        ; ; ; /* */
11:        if  then
12:           ; ; ; /* */
13:        end if
14:        if  then
15:           ;
16:        else if  then
17:           ;
18:        else if  then
19:           ;
20:        end if
21:     end for
22:  end for

 

Fig. 9: Algorithmic procedure for the PDD between two triangles sharing a common side and forming a concave quadrangle.

A concave quadrangle formed by two triangles is shown in Fig. 4(b). Similarly, for the convenience of calculation by using trigonometry, the line orientation with regard to -axis can be categorized into six cases, as shown in Fig. 8. Given , for each line intersecting with both triangles, the length of the segment in is and that in is . The length of the segment between the above two is . Note that when the line intersects with . The distances between and , and and are and , respectively. Figure 9 summarizes the derivation process. For verification, the following two triangles are used: and . The analytical results in close match with the simulation results are shown in Fig. 7.

Ii-C Two Triangles Share a Vertex

(a) two triangles in a pentagon: R1&R3
(b) two triangles in a hexagon: R1&R3, R1&R4, and R2&R4
Fig. 10: Two triangles within a polygon sharing a vertex.
(a) PDD between two triangles in a pentagon
(b) PDD between two triangles in a hexagon
Fig. 11: PDD between two triangles in a polygon sharing a vertex.

For the simplicity of dividing the range of the line orientation, two special cases are employed for demonstration: [a] two triangles sharing a common vertex are within a regular pentagon, as shown in Fig. 10(a), and [b] two triangles sharing a common vertex are within a regular hexagon, as shown in Fig. 10(b). Note that our approach is not limited to regular polygons, but also applies to other cases associated with arbitrary triangles.

For case [a], the two triangles are labeled by R1 and R3, respectively. With on -axis, the line orientation with regard to -axis falls into five subcases: (i) ; (ii) ; (iii) ; (iv) ; (v) . Note that the lines with in (ii) will not be considered, since none of them intersects with both of the triangles. The algorithmic procedure shown in Fig. 9 can still obtain the PDD between the two triangles, only with the difference in calculating (line 37), , , and (line 9). Figure 11(a) shows the comparison in a close match with simulation. For case [b] where the regular hexagon is triangulated as shown in Fig. 10(b), the two triangles are either R1 and R3, R1 and R4, or R2 and R4. According to the symmetry of the regular hexagon, the PDD between R1 and R3 is identical with that between R2 and R4. With the same method, the results are shown in Fig. 11(b).

Iii PDDs for Arbitrary Polygons

(a) PDD within a pentagon
(b) PDD within a hexagon
Fig. 12: PDD within a polygon.

With the triangle-PDDs obtained above, the PDD associated with arbitrary polygons can be obtained through a Decomposition and Recursion (D&R) approach, since any polygon can be triangulated. Therefore, the PDD-based performance metrics of wireless networks associated with arbitrary polygons can be quantified accurately.

Taking the regular pentagon with the triangulation shown as in Fig. 10(a) for example, through D&R, the CDF of the PDD within the pentagon is given by a probabilistic sum,

where is the area of the pentagon. The comparison with simulation is shown in Fig. 12(a). Likewise, the CDF of the PDD within the regular hexagon of area , with the polygon triangulation shown as in Fig. 10(b), is

The comparison with the existing result obtained in [3] and simulation in a close match is shown in Fig. 12(b).

Iv PDDs for Ring Geometries

(a) Square ring
(b) Hexagon ring
Fig. 13: Two ring geometries.
(a) PDDs associated with square ring
(b) PDDs associated with hexagon ring
Fig. 14: PDDs associated with ring geometries.

In this section, we show the PDDs associated with ring geometries by applying the D&R approach. For ease of presentation, we use two examples, one is a square ring as shown in Fig. 13(a), and the other is a hexagon ring as shown in Fig. 13(b).

For the square ring, we consider a unit square (i.e., the side length of the square is ) labeled by , with a smaller square (its side length is ) located in the center and labeled by . The ring area in grey is labeled by . We use to denote the CDF of the random distances within , and the CDF of the random distances between and . and can be obtained with the developed approach directly. Then with a weighted probabilistic sum,

(8)

based on which , , and can be obtained. The obtained CDFs of the PDDs of interest are shown in Fig. 14(a). Similarly, the CDFs of the PDDs associated with the hexagon ring are shown in Fig. 14(b), where the radius of the circle in the center of the unit hexagon (its side length is ) is . Note that if there are nodes deployed in and but with different node densities from each other, the above weighted probabilistic sum is still applicable with different weights due to the node density differences, which shows the way of handling nonuniform node distributions.

V Conclusions

In this report, we first applied the proposed algorithmic approach to obtain the random PDDs associated with arbitrary triangles (triangle-PDDs). Since any polygons can be triangulated, we then used the decomposition and recursion approach for arbitrary polygons based on triangle-PDDs. Finally, the PDDs associated with ring geometries were also shown. The algorithmic procedures were provided to show the mathematical derivation process, based on which either the closed-form expressions or the algorithmic results can be obtained. Together with [1], and the decomposition and recursion approach, all random distances associated with random polygons, regardless between two random points or with an arbitrary reference point, can be obtained, so for any arbitrary geometry shapes with any needed approximation precision.

Acknowledgment

This work is supported in part by the NSERC, CFI and BCKDF. We also thank Dr. Lin Cai for her constructive suggestions and encouragement, and Drs. Lei Zheng and Maryam Ahmadi for their comments and suggestions to this work.

References

  • [1] M. Ahmadi and J. Pan. Random distances associated with arbitrary triangles: a recursive approach with an arbitrary reference point. UVic-PanLab-TR-14-01, 2014. [Online] http://hdl.handle.net/1828/5134.
  • [2] F. Tong, M. Ahmadi, and J. Pan. Random distances associated with arbitrary triangles: a systematic approach between two random points. arXiv:1312.2498, 2013.
  • [3] Y. Zhuang and J. Pan. Random distances associated with hexagons. arXiv:1106.2200, 2011.
  • [4] Y. Zhuang and J. Pan. Random distances associated with equilateral triangles. arXiv:1207.1511, 2012.
Comments 0
Request Comment
You are adding the first comment!
How to quickly get a good reply:
  • Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
  • Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
  • Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
""
The feedback must be of minimum 40 characters and the title a minimum of 5 characters
   
Add comment
Cancel
Loading ...
294392
This is a comment super asjknd jkasnjk adsnkj
Upvote
Downvote
""
The feedback must be of minumum 40 characters
The feedback must be of minumum 40 characters
Submit
Cancel

You are asking your first question!
How to quickly get a good answer:
  • Keep your question short and to the point
  • Check for grammar or spelling errors.
  • Phrase it like a question
Test
Test description