title: Rotating ellipse in python using x,y,theta
body: <p>I'm trying to draw an ellipse in python using the following equations:</p>
  
  <pre><code>xpos = a*np.cos(theta)
  ypos = b*np.sin(theta)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/a0YYf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a0YYf.png" alt="Ellipse"></a></p>
  
  <p>This works, but when I try to rotate the resulting ellipse using:</p>
  
  <pre><code>xpos = xpos*np.cos(np.pi/2)+ypos*np.sin(np.pi/2)
  ypos = -xpos*np.sin(np.pi/2)+ypos*np.cos(np.pi/2)
  </code></pre>
  
  <p>The ellipse becomes a line, rather than just rotated by 90 degrees. What is causing this?<a href="https://i.stack.imgur.com/uOJ0l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uOJ0l.png" alt="Rotated ellipse"></a></p>