Search code examples
iphonedrawrect

Drawing ellipse inside rotated rectangle


I am drawing rectangle with 4 points as below figure (I also have angle of the rectangle). How to draw ellipse inside the rotated rectangle?

enter image description here


Solution

  • I would draw the rectangle (without rotation), then the ellipse (without rotation) and finally apply a rotation transformation to both of them. Use CGAffineTransform.