title: How draw axis of ellipse
body: <p>I am using <code>fitellipse</code> of Opencv and C++, and I'm getting these values:</p>
  
  <pre><code>/// Find the rotated rectangles and ellipses for each contour
  vector&lt;RotatedRect&gt; minRect( contours.size() );
  vector&lt;RotatedRect&gt; minEllipse( contours.size() );
  
  for( int i = 0; i &lt; contours.size(); i++ )
  {
     minRect[i] = minAreaRect( Mat(contours[i]) );
  
     if( contours[i].size() &gt; 5 )
        minEllipse[i] = fitEllipse( Mat(contours[i]) );
  
     // ...
  }
  
  float xc    = minEllipse[element].center.x;
  float yc    = minEllipse[element].center.y;
  float a     = minEllipse[element].size.width  / 2;   
  float b     = minEllipse[element].size.height / 2;
  float theta = minEllipse[element].angle; 
  </code></pre>
  
  <p>But with these values how can I draw the axis of an ellipse, for example of the following ellipse?
  <a href="https://i.stack.imgur.com/17heo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/17heo.png" alt="enter image description here"></a>  </p>
  
  <p>NOTE: Element is an ellipse stored in <code>minEllipse</code>.</p>