Regular polygons: how to get random point position from two consecutive perpendicular projections.

70 Views Asked by At

Given a regular polygon with $n$ sides and a random point $P$ inside the polygon, we will draw $n$ perpendicular projections from this point to the $n$ polygon sides. Denote the point of intersection of the $i$th projection and the corresponding polygon side as $p_i$. The length of each segment from $p_i$ to the next cw polygon vertex is denoted as $a_i$. Given the first two consecutive segments and the polygon side length $a_1$ and $a_2$, how can we determine $a_3$ to $a_n$?

An example for a pentagon is shown in this image: Regular Pentagon

I tried getting the coordinates of $P$ and then generate the polygon vertices' coordinates which will make it easier. How can I get the coordinates of $P$? Are there more effective approaches?

1

There are 1 best solutions below

0
On

Let the side length of the regular polygon be $a$, and number of its sides be $n$. Take two consecutive adjacent sides $S_1$ and $S_2$ such that $S_2$ is counter clockwise from $S_1$. Let $O$ be the vertex joining $S_1$ and $S_2$. Place $O$ at the origin of the Cartesian plane $(0,0)$, and let $S_1$ extend from $(0,0)$ to $(a, 0)$. Let $\phi$ be the internal angle of the polygon, then

$ \phi = 180^\circ \dfrac{(n - 2)}{n} $

Therefore, $S_2$ will extend from $(0,0)$ to $( a \cos \phi , a \sin \phi ) $

Point $p_1$ , the projection of point $P$ onto $S_1$ has the coordinates $(a_1, 0)$

and Point $p_2$ , the projection of point $P$ onto $S_2$ has the coordinates $((a - a_2) \cos \phi , (a - a_2) \sin \phi) $

Since $p_1$ and $p_2$ are projection onto $S_1$ and $S_2$, then we the normal vectors to $S_1$ and $S_2$

The unit normal to $S_1$ is $n_1 = (0, 1)$ while the unit normal to $S_2$ is $ n_2 = (\sin \phi, - \cos \phi ) $

Now, we know that $P$ lies the following two "normal" lines

$ \ell_1(t) = p_1 + t n_1 $

and

$ \ell_2(s) = p_2 + s n_2 $

Point $P$ is the intersection of these two lines. That is,

$ P = p_1 + t n_1 = p_2 + s n_2 $

In linear algebra notation, the last equality is

$ \begin{bmatrix} n_1 && (- n_2) \end{bmatrix} \begin{bmatrix} t \\ s \end{bmatrix} = \begin{bmatrix} p_2 - p_1 \end{bmatrix} $

Substituting $n_1$ , $n_2$ , $p_1$ and $p_2$ we get,

$ \begin{bmatrix} 0 && - \sin \phi \\ 1 && \cos \phi \end{bmatrix} \begin{bmatrix} t \\ s \end{bmatrix} = \begin{bmatrix} (a - a_2) \cos \phi - a_1 \\ (a - a_2 ) \sin \phi \end{bmatrix} $

From the first equation, we get

$ s = \dfrac{ a_1 - (a - a_2) \cos \phi } { \sin \phi } $

Hence,

$P = p_2 + s n_2 = ( (a - a_2) \cos \phi, (a - a_2) \sin \phi) + \dfrac{ a_1 - (a - a_2) \cos \phi } { \sin \phi } (\sin \phi, -\cos \phi) \\= ( a_1 , - a_1 \cot \phi + (a - a_2) ( \sin \phi + \cos \phi \cot \phi )) \\= \dfrac{1}{\sin \phi} ( a_1 \sin \phi , - a_1 \cos \phi + (a - a_2) ) $

Having obtained $P$, we can now project it on the other $(n-2)$ sides

First compute the coordinates of the center of the polygon, if $L$ is the apothem then the center is given by

$ C = (\dfrac{a}{2} , L) $

It is known that $L = \dfrac{a}{2} \tan \dfrac{\phi}{2} $

Hence,

$ C = \dfrac{a}{2} ( 1 , \tan \dfrac{\phi}{2} ) $

While the radius of the polygon is

$ R = \dfrac{a}{2} \sec \dfrac{\phi}{2} $

Now, for $k = 3, 4, \dots, n $, we have the vertex $V_k$ given by

$V_k = C + R ( - \sin ( \dfrac{\pi}{n} + (k-1) \dfrac{2 \pi}{n} ) , - \cos ( \dfrac{\pi}{n} + (k-1) \dfrac{2 \pi}{n} )) $

While the normal vector for the sides numbered $k = 3, 4, \dots , n $ are given by

$ n_k = \left( \sin \left( \dfrac{2 (k-1) \pi}{n} \right) , \cos \left( \dfrac{2 (k-1) \pi}{n} \right) \right)$

Now the length of the perpendicular dropped from $P$ onto the $k$-th side is

$ d_k = n_k \cdot (P - V_k) $

where $\cdot$ denotes the dot product between these two vectors. And the distance from $P$ to $V_k$ is

$ e_k = \sqrt{(P - V_k) \cdot (P - V_k)} $

Hence, the required distance $a_k$ is given by

$ a_k = \sqrt{ e_k^2 - d_k^2 } = \sqrt{ (P - V_k)^T (I - {n_k}{n_k}^T) (P - V_k) } $