Equation of regular polygon


 * A student asks,
 * How can I write the equation of a regular polygon using polar coordinates?


 * MathHelp replies,

Consider the equation of just one side of an n-gon with radius 1. Better yet, consider the equation of just one half of one side of the n-gon. It's the side of a right triangle opposite angle A = &pi;/n. The hypotenuse of this triangle is 1 (the radius of the n-gon), so the equation of this one side is cos(&pi;/n)/cos(&theta;), where &theta; goes from 0 to &pi;/n. The other half of this side has the same equation, so we're already at the point where we know the equation of one side of the n-gon:


 * r = cos(&pi;/n) / cos(&theta;), -&pi;/n &le; &theta; &le; &pi;/n

Next, we will need to develop a function of &theta; that "normalizes" &theta; to be within plus or minus &pi;/n. This is accomplished by the "floor" function, as follows:


 * B = &theta; - 2 &pi;/n floor((n &theta; + &pi;)/(2 &pi;))

Putting it together, the equation of an n-gon is r = cos(A)/cos(B), which is


 * r = cos(&pi;/n)/cos(&theta; - 2 &pi;/n floor((n &theta; + &pi;)/(2 &pi;)))

External references

 * Wolfram Alpha plot of a pentagon