I have an app that I am working on. A bitmap will have a rectangle drawn on it. I need to rotate the rectangle anywhere from 0 - 360 degrees along its center point. After the rectangle is rotated I need to calculate if any given point int the picture falls inside the rectangle. All distances in centimeters. Looking for a good way to calculate using the following inputs:

bitmap width - width of the whole image

bitmap height - height of the whole image

rectangle width - width of the rectangle drawn

rectangle height - height of the rectangle drawn

angle of rotation - rotated clockwise 360 degrees

The point that is given can be expressed as an x,y position from the top left corner of the bitmap or a distance from the center of the rectangle