I want to draw no of bezier curves in circle using for loop. Until now I'm able to put no of bezier curves in circular mode, but these curves are not curved, they are just straight lines because I have not been able to change the handle properly which will make these curves curved. You can see my code here, please let me know my mistakes.
I have also tried to fill color into curves, but that's not also happening and I don't know why.
<html>
<body>
<style>
*{
margin: 0px;
}
body{
background-color: aqua;
}
canvas
{
background-color: white;
}
</style>
<canvas id="mycanvas"></canvas>
<script>
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
x = window.innerWidth/2;
y = window.innerHeight/2;
r = window.innerWidth;
theta = 0.1;
for(theta=0.1; theta<12.6; theta+=0.1) {
ctx.beginPath();
ctx.moveTo(x, y);
ctx.bezierCurveTo(x,y,x,y, x+ r * Math.cos(theta),y + r * Math.sin(theta));
ctx.lineWidth = 1;
ctx.strokeStyle = "black";
ctx.stroke();
ctx.closePath();
ctx.fill();
}
for ( i=r/16; i < r; i=i+r/12 ) {
ctx.beginPath();
ctx.arc(x, y, i, 0, 2 * Math.PI, false);
ctx.stroke();
}
</script>
</body>
</html>