How to draw a quadratic curve in JavaScript

1 Answer

0 votes
<canvas id="canvas"></canvas>
<script type="text/JavaScript">   
           
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

// void ctx.quadraticCurveTo(cpx, cpy, x, y);

ctx.beginPath();
ctx.moveTo(50, 30);
ctx.quadraticCurveTo(240, 30, 40, 150);
ctx.stroke(); 

</script>

 



answered May 27, 2016 by avibootz

Related questions

...