I was looking at some equilateral triangles and started drawing up some equations and I came across the following (it may take some time for my actual question to come):

Suppose that we put a point $D$ anywhere within the triangle. Then we draw lines to each vertex of the triangle, we can now see that we form $3$ triangles, namely $ABD, ACD$ and $BCD$. Further draw lines perpendicular from $D$ to each side of the triangle, the lines $DE, DG$ and $DF$.

We can also note that $AH$ is the height of the triangle (we'll call the height $h$). For simplicity we will also call the sides $AC = AB = BC = S$. We will also rename the perpendicular lines from $D$ to each side; $L_1, L_2$ and $L_3$ respectively (for our purposes it doesn't matter which line is which $L_n$).

We can easily see that everything done so far is valid no matter where we put the point $D$ because we can always the draw the lines.

Now the definitions are done, so we can start looking at the area of $ABC$. This is just $\frac{bh}{2} = \frac{Sh}{2}$. The area can also be derived from adding together the area of triangles $ABD, ACD$ and $BCD$. The area for each small triangle is just $\frac{SL_n}{2}$.

Now set the two equations for the areas to equal each other: $$\frac{Sh}{2} = \frac{SL_1}{2} + \frac{SL_2}{2} + \frac{SL_3}{2}$$ $$h =L_1 + L_2 + L_3$$

Which is quite interesting. No matter where we put a point $D$, the perpendicular lengths from $D$ to the sides always sum up to the height of the triangle.

My next step was to extend this to all regular polygons, which led me to derive the following:

$$\frac{2A_n}{S} = \sum_{i=1}^{n} L_i$$

Where $A_n$ is the area of some regular polygon and the subscript $n$ denotes how many sides it has.

I was wondering if anyone has some material about this? Where it's e.g. extended to other shapes/higher dimensions etc. Thank you for your help.