PDA

View Full Version : draw ellipse with specific points in scene



wagmare
11th December 2013, 06:45
hi friends,Experts,
i want to know how i can draw ellipse with the three points marked in the qgraphicsscene . say if the user selects three points in the scene using mousePress i will highlight the pressed points with marks . now using the the three marks i have to draw an ellipse around the three marks or making the points as a boundary for the ellipse i draw .9843 . please help me . suggest me the way i can implement .

Santosh Reddy
11th December 2013, 08:31
i want to know how i can draw ellipse with the three points marked in the qgraphicsscene
It better be a circle (there will be infinitely many ellipses that pass through those points).

Read more about Circumscribed circle (http://en.wikipedia.org/wiki/Circumcircle), all the required math is mentioned there. All you need to do is calculate the circle centre and radius, and use Qt API void drawEllipse(const QPoint & center, int rx, int ry);