Calculate the number of times an angle must be repeated for it to complete a full rotation and for it to close

136 Views Asked by At

I'm trying to calculate the number of times an angle must be repeated to make a full rotation and become closed.

Example: The internal angle of a pentagon is 108 degrees and it must repeat 5 times to complete a rotation and it closes at 540 degrees. It closes a 540 degrees because that's when all the sides meet and close. http://www.mathsisfun.com/geometry/interior-angles-polygons.html

How can I calculate these numbers for arbitrary angles like 72 degrees or 117 degrees, etc..

Does anyone know of a way to calculate this

Ps: I'm using matlab/octave thanks

3

There are 3 best solutions below

5
On BEST ANSWER

This is only possible for $$\frac{\phi}{2\pi} =: a \in \mathbb{Q}$$ If $a = \frac{p}{q}$ is the irreducible form of $a$, i.e. $p$ and $q$ are relatively prime, then the sought value is $q$; the number of performed revolutions is $p$. I don't know of any efficient algorithm for this, especially as MATLAB / Octave work with numeric approximations to the values

function n=getRev(a)
b=a;
n=1;
while (abs(b-round(b) > 1e-15))
b = b+a;
n = n+1;
end
end


Code for outer angles:
function n=getOuterRev(a)
b=a;
n=1;
k=(n-2)/2;
while (abs(b-k) > 1e-15)
b = b+a;
n = n+1;
k = (n-2)/2;
end
end

2
On

There is a formula, known as $180* (n-2)$ where n is the number of sides that gives you your answer. For example, in a pentagon,

$180*(5-2)$ = $540$

0
On

As AlexR alread noted, we need $\frac{\phi}{2\pi}\in\mathbb Q$. So put $\frac{\phi}{2\pi}=\frac{p}{q}$. There is a "complete rotation", if $$\varphi\cdot n=\pi\cdot k$$ where $n$ is the number of repetitions and $k\in\mathbb Z$. So $$\frac pq 2\pi\cdot n=\pi\cdot k\Rightarrow 2pn=kq$$ For any common multiple of $2p$ and $q$, we can choose $k$ and $n$ in a way, such that the equation holds and $2pn=kq$ is this common multiple. So the smallest solution for $2pn$, will be $lcm(2p,q)$, hence $$n=\frac{lcm(2p,q)}{2p}=\frac{q}{\gcd(2p,q)}$$

Note, that $108^\circ=\frac{3}{10}\cdot 2\pi$, so $n=\frac{10}{\gcd(6,10)}=\frac{10}{2}=5$.