Finding pixel inside rotation rectangular around a point

251 Views Asked by At

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