Drawing a full ellipse

by jwerre

HTML

<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/ellipse -->

<canvas id="canvas" width="200" height="200"></canvas>

JavaScript

const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');

// Draw the ellipse
ctx.beginPath();
ctx.ellipse(100, 100, 75, 75, Math.PI / 4, 0, 2 * Math.PI);
ctx.stroke();