MATLAB: How to calculate the angle between two lines from the same origin

euclidean distance and angleimage processing

Please I need help on this, I have extracted severla minutia points from this fingerprint image and I have been able to calculate the angle of each minutia according to the ridge direction, which i have dipslayed in green small arrows, and i want to take one of the minutia as a reference point and calculate the distance and angle each other minutia forms with the reference minutia, that is the angles in orange color, please help me on this. thanks

Best Answer

O = [0. 0.] ; % origin
% Two points
A = rand(1,2) ;
B = rand(1,2) ;
u = O-A ;
v = O-B ;
CosTheta = (dot(u,v) / (norm(u)*norm(v)));