6

So I came across this picture on Google+ and I wanted to understand further. I created an equation for the second wave, the one with the square. Here it is: $$y=\frac{\sin x}{\cos(\min(x \mod \pi/2, \pi/2- (x \mod \pi/2)))}$$

(The equation plotted on Wolfram Alpha.)

It's fine, but I feel like using mod and min is kind of nasty. Can anyone offer improvement to my equation and/or general insight towards further polygons?

Mårten W
  • 3,480
Flowers
  • 775
  • 4
  • 13

1 Answers1

3

Start with a "triangle" function of period $2 \pi/n$, minimum value $0$ and maximum value $\pi/n$: a suitable choice is $T_n(t) = \frac{1}{n} \arccos(\cos(n t))$. A regular $n$-gon of inradius $r_0$ is given, in polar coordinates, by $r = r_0/\cos(T_n(\theta - \theta_0))$. Its $y$ coordinate is then $$y = \dfrac{r_0 \sin(\theta)}{\cos(T_n(\theta - \theta_0))}$$

Here is a similar animation using a pentagon ($n=5$):

enter image description here

Robert Israel
  • 448,999
  • Thanks for the answer, but I'm not sure I understand. How do you find the T function? The one you provided simplifies itself to the argument for any n. Can you please explain further? Cool animation btw – Flowers Sep 09 '13 at 06:09
  • No, it's not the argument. The point is that by definition $\arccos(anything)$ is always in the interval $[0, \pi]$. For $0 \le t \le \pi/n$ you do have $T_n(t) = t$. But in the next interval $\pi/n \le t \le 2\pi/n$ you get $T_n(t) = 2\pi/n - t$ (its value at $t = \pi/n$ is $\pi/n$, but at $t = 2\pi/n$ it's back to $0$). And then it repeats. The result is a "triangular wave". – Robert Israel Sep 09 '13 at 06:59