Prev Demo
X Coordinate Of The Canvas
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>X- cordinate of the arc</title> </head> <body> <h2 style="color:green">x-coordinate moves right from the canvas </h2> <canvas id="myCanvas" width="400" height="250" style="border:5px solid red;"> </canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); context.beginPath(); context.arc(300, 75, 50, 0 * Math.PI, 1.5 * Math.PI); context.stroke(); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output