For help, draw hexagons about cancas! ! ! ! ! !

  node.js, question
drawStart(ctx, 150, 300, 400, 400);
 
 function drawStart(ctx, r, R, x, y){
 ctx.beginPath();
 
 for(var i = 0;   i < 5;  I plus)
 Ctx.lineTo(Math.cos((18+i * 72)/180 * Math.PI) * R+x),
 -Math.sin((18+i * 72)/180 * Math.PI) * R+y);
 
 Ctx.lineTo(Math.cos((54 plus i * 72)/180 * Math.PI) * r plus x),
 -Math.sin((54+i * 72)/180 * Math.PI) * r+y);
 bracket
 
 ctx.closePath();
 ctx.stroke();
 bracket

The above is the code for drawing a pentagon. How do you change the line with the right six sides?

Regard canvas as a coordinate axis and just take out the coordinates of each point.