Find distance on the side of polygon to create angle

41 Views Asked by At

I'm trying to develop an application (with programming languages) where I can create 6 sided polygons with the same angle, wich is 60º deg, for example, to create the sides, like the image below. The only thing I know is the height of this object and the angle to be used.

This is an example of the result I expect to achieve:

enter image description here

Is there a formula to calculate the distance the point needs to be from the left side to achieve that angle? See image below.

enter image description here

I want to be able to change the height of the element, but keep the proportion of the polygon in all elements, wich is 60º.

I tried to use this formula, but it's not working:

$$x = tan(60º) * h$$

1

There are 1 best solutions below

2
On BEST ANSWER

So this is what I did, it gives you $x = 20/\sqrt{3}$.

Here is what I did

So more generally for a $n$-agon then you have the angle $\alpha = 180°-360°/n$ (on the sketch $\alpha = 120°$) and therefore $x = \tan((180°-\alpha)/2) \times \frac{h}{2}$ hence:

$$\boxed{x = \tan\left(\frac{180°}{n}\right)\times \frac{h}{2}}$$