I'm using c++ in Qt and I would like to draw an ellipse. From the Qt documentation I found that I can use drawEllipse to draw an ellipse from a boundary rectangle:
void QPainter::drawEllipse(const QRectF &rectangle)
and the rectangle is given by:
QRectF(qreal x, qreal y, qreal width, qreal height)
However, this only provides an ellipse with horizontal/vertical major and minor axis.
My ellipse is given by two coordinate sets to denote the major axis and a ratio between the length of the major and minor axes. Therefore the axes can have a slope that is not horizontal or vertical. (I need to use this method anyway since I also export it to a dxf file, which has this notation)
My question is:
Is there any other way to draw an ellipse than using a boundary rectangle and then rotating it?
It seems a little silly to put it in a horizontal/vertical rectangle and then computing the rotation when I have the axes coordinates from the beginning.