/* Draw epicycloid twice in same space */ t: makelist(j/100, j, 0, %pi*200)$ u: length(t)$ v1: round(3 * u / 4)$ x1: ev(4 * cos(t), numer)$ /* create table of Sine */ y1: append(makelist(x1[j], j, v1 + 1, u), makelist(x1[j], j, 1, v1))$ v2: round(3 * u / 16)$ x2: ev(cos(4 * t), numer)$ /* create table of Sine */ y2: append(makelist(x2[j], j, v2 + 1, u), makelist(x2[j], j, 1, v2))$ x: x1 - x2$ y: y1 - y2$ kill(v1, v2, x1, x2, y1, y2)$ /* default color, blue */ draw2d(nticks=150, transparent=true, polygon(makelist([x[j], y[j]], j, 1, u)), color=red, polygon(makelist([x[j], 4 * sin(t[j]) - sin(4 * t[j])], j, 1, u)) );