the Mystic Rose

This is a real favourite of mine.


We start with an 11-sided polygon and then join every vertex to every other vertex.


We already have a function to draw the polygon BUT we now require it larger and centered on the screen.


We will also need a function to join two points: join(x1,y1,x2,y2).

Create this function and then click here to see my answer.

function join(x1,y1,x2,y2) {
  g_ctx.beginPath();
  g_ctx.moveTo(x1,y1);
  g_ctx.lineTo(x2,y2);
  g_ctx.stroke();
}