MATLAB: How to locate a point on an image relative to a reference point from another image

anglesimage processingmathematicspoint matching algorithm

I want to be able to find the location of M1 on the second image relative the the R line, given the R line to be the reference line from the first image, and the R line has been found on the second image but with different angles to the horizontal axis. The two images are same here for illustration but in use is going to be different images but the same fingerprint so there could be rotation of the R line in the second image from the first. Please how do I go about this?
Thanks.

Best Answer

Use atan2 function
ar = atan2(yr,xr); % angle or R point
am = ar + m1; % angle of M point
[xm,ym] = pol2cart(am,rm); % cartesian coordinates of M point (rm - radius)