How do I draw an ellipse with arbitrary orientation pixel by pixel?

Posted by amc on Stack Overflow See other posts from Stack Overflow or by amc
Published on 2010-06-11T19:07:18Z Indexed on 2010/06/11 19:13 UTC
Read the original article Hit count: 231

Filed under:
|
|

Hi,

I have to draw an ellipse of arbitrary size and orientation pixel by pixel. It seems pretty easy to draw an ellipse whose major and minor axes align with the x and y axes, but rotating the ellipse by an arbitrary angle seems trickier. Initially I though it might work to draw the unrotated ellipse and apply a rotation matrix to each point, but it seems as though that could cause errors do to rounding, and I need rather high precision.

Is my suspicion about this method correct? How could I accomplish this task more precisely?

I'm programming in C++ (although that shouldn't really matter since this is a more algorithm-oriented question).

© Stack Overflow or respective owner

Related posts about graphics

Related posts about shapes