Finding pixel inside rotation rectangular around a point

I would like to determine that pixels are inside a rotated rectangle around the center of the circle.

Let: say I have a circle radius R at the center ( x0, y0 ) Given: theta as the degree of rotation rectangle round the center point and width ( W ) of the rectangle. The image below illustrates the problem

How could I determine which pixel x,y is inside or outside the rectangle?.

Current: What I am doing now is I rotate the points of rectangles and then find inside/outside using those rotated points. I feel it is not efficient.

enter image description here

• Do you mean entirely inside the rectangle? In the picture there appears to be no pixel entirely inside the rectangle, assuming the grid lines are one pixel apart. Of course, you couldn't actually draw the rectangle, which consists of partial pixels (if I'm right about the grid lines.) Please add some more details to your question. – saulspatz Jan 2 at 6:02
• I fixed the picture. may be partly inside or fully inside is fine too. The new picture is better. – MooMoo Jan 2 at 6:21
• You want it as function of Theta? – Moti Jan 2 at 7:45