title: Scaling the X axis of a rotated ellipse
body: <p>I have a scatter plot and I'm allowing points to be selected by drawing an ellipse like so:</p>
  <p><a href="https://i.stack.imgur.com/kpRdV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kpRdV.png" alt="enter image description here" /></a></p>
  <p>In the above image the X axis and Y axis are scaled differently. I'm trying to implement functionality to allow the scale of each axis to be changed, but I'm having trouble scaling the ellipse shape with the axis. Changing the scale of the X axis to match the Y axis gives this:</p>
  <p><a href="https://i.stack.imgur.com/U3KK8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U3KK8.png" alt="enter image description here" /></a></p>
  <p>I know I can scale the cx value of the ellipse with the X axis to get the new centre of the ellipse, but I don't know how to work out the new rx, ry and rotation angle. So my question is given a rotated ellipse with values <em>cx, cy, rx, ry</em> and <em>rotation in radians</em>, how do I calculate the new values for the ellipse given a scale value <em>s</em> for either the X axis or Y Axis? For clarity the rotation is done about the centre (cx, cy) of the ellipse.</p>