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

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

 fsD=1sfD(ds) , (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.

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,

 fiD(d)={fi1   γ≤π2−βfi21+fi22   otherwise, (2)

where

 fi1=⎧⎪ ⎪⎨⎪ ⎪⎩Hi1(0,θi1)+Hi2(0,θi1)0≤θi1≤γHi1(0,γ)+Hi2(0,γ)θi1>γ0otherwise, fi21={Hi1(0,θi1)+Hi2(0,θi1)0≤θi1≤π2−β0otherwise, fi22={Hi1(θi2,γ)+Hi2(θi2,γ)θi2≤γ0otherwise, Hi1(X,Y)=1S2∫YX∫p1d⋅p1base2d(l1−d) dpdθ , (3) Hi2(X,Y)=1S2∫YX∫pm−d⋅p2basep12d(l2−d) dpdθ . (4)

Similarly, for case (ii), we have

 fiiD(d)=fii1+fii2 , (5)

where

 fii1={Hii1(γ,θii1)+Hii2(γ,θii1)γ≤θii1≤π20otherwise, fii2={Hii1(θii2,π−β)+Hii2(θii2,π−β)θii2≤π−β0otherwise, θii1=arcsin(csin(β)d) ,θii2=π−arcsin(csin(β)d) ,

and for case (iii),

 fiiiD(d)={fiii1   β≤π2−γfiii21+fiii22   otherwise, (6)

where

 fiii1=⎧⎪⎨⎪⎩Hiii1(π−β,π)+Hiii2(π−β,π)θiii1<π−βHiii1(θiii1,π)+Hiii2(θiii1,π)π−β≤θiii1≤π0otherwise, fiii21={Hiii1(π−β,θiii2)+Hiii2(π−β,θiii2)π−β≤θiii2≤π2+γ0otherwise, fiii22={Hiii1(θiii1,π)+Hiii2(θiii1,π)θiii1≤π0otherwise, θiii1=π−arcsin(csin(α)d)+γ,θiii2=arcsin(csin(α)d)+γ.

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

 fD(d)=fiD(d)+fiiD(d)+fiiiD(d) . (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

 ⎧⎪ ⎪⎨⎪ ⎪⎩Hi1(X,Y)=hi1(Y)−hi1(X),Hi2(X,Y)=hi2(Y)−hi2(X),Hii1(X,Y)=hii1(Y)−hii1(X),Hii2(X,Y)=hii2(Y)−hii2(X),Hiii1(X,Y)=hiii1(Y)−hiii1(X),Hiii2(X,Y)=hiii2(Y)−hiii2(X) ,

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  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.

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 , 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.

### 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:

 [a]: ∠1≥∠2, ∠3≥∠4, [b]:∠1≥∠2, ∠3≤∠4, [c]: ∠1≤∠2, ∠3≥∠4, [d]:∠1≤∠2, ∠3≤∠4.

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.

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

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

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

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,

 F=2S1S(S1SF11+S3SF13+S2SF12)+S3S(S3SF33% +2S1SF13) ,

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

 F=2S1S(S1SF11+S2SF12+S3SF13+S4SF14)+2S2S(S1SF12+S2SF%22+S3SF23+S4SF24) .

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

## Iv PDDs for 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,

 F11=S2S1(S2S1F22+S3S1F23)+S3S1(S2S1F23+S3S1% F33)=S2S1F12+S3S1F13 , (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 , 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

•  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.
•  F. Tong, M. Ahmadi, and J. Pan. Random distances associated with arbitrary triangles: a systematic approach between two random points. arXiv:1312.2498, 2013.
•  Y. Zhuang and J. Pan. Random distances associated with hexagons. arXiv:1106.2200, 2011.
•  Y. Zhuang and J. Pan. Random distances associated with equilateral triangles. arXiv:1207.1511, 2012.
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   