title: Get coordinates of the points in an ellipse in HTML5 Canvas
body: <p>In HTML5 Canvas, I know I can draw an ellipse with <code>CanvasRenderingContext2D.ellipse()</code>, but how can I draw some points on the ellipse path?</p>
  <p>I can draw points on a circular path using the following codes:</p>
  <pre><code>const canvas = document.getElementById('thumbCanvas');
  const ctx = canvas.getContext('2d');
  const distance = 200;
  const centerX = canvas.width / 2;
  const centerY = canvas.height / 2;
  var angle = 0;
  for(i = 0; i &lt; 36; i++) {
    angleInRadian = angle * Math.PI / 180;
    ctx.fillRect(centerX - imgWidth / 2 + distance * Math.cos(angleInRadian), centerY - imgHeight / 2 + distance * Math.sin(angleInRadian), 5, 5);
    angle += 10;
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/rs2vs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rs2vs.png" alt="Screenshot" /></a></p>
  <p>p.s. ignore the colors and the dot at the center.</p>
  <p>But how to do this with an ellipse? I don't want to use <code>ctx.scale()</code> to distort the whole image.</p>