Polyous

→ Lissajous Curve (Wikipedia)

Starting with, as usual, a “what if,” the “if” in this case referring to the idea of tracing the perimeter of polygons instead of circles when generating a Lissajous Curve, I consulted with a very clever friend.

In short order and before he cooked dinner he provided a very helpful image: A very helpful image

Some discussion and a little coding later we arrived at this function:

float polySin(float t, float n) {
  t = t % 360;
  t = t / 360f;
  t = t * n;
  float i = floor(t);   
  float q = t - floor(t);
  float[] p0 = segCoord(i, n);
  float[] p1 = segCoord(i + 1, n);

  float x = p0[0] + q * (p1[0] - p0[0]);  
  return x;
}

Lissajous polygon experiment Tracing with angles instead of arcs