Polar equation for a Heptagon

212 Views Asked by At

What is polar equation of a Heptagon ? I need to move some Android views in the form of a heptagon, for I need to have polar equations for Heptagon like for $x= r\sin(\theta)$ and $y=r\cos(\theta)$.

Is it possible to have polar equation for a heptagon too ?

1

There are 1 best solutions below

1
On

A general formula for a regular polygon of radius $r$ with $n$ sides, denote $c_n = \cos(\pi/n)$, $s_n = \sin(\pi/n)$ and

$$f_n(x+iy) = \left||rs_n - |y|| - (rs_n - |y|)\right| + |x-rc_n|$$

then your polygon is given by

$$\prod_{k = 0}^{n-1} f_n\left(e^{-\frac{2 i k \pi}{n}} (x+iy)\right) = 0$$

(For heptagone $n = 7$).