If I have the origin of axis in (0,0) and I want to calculate the angle of different lines connecting some points to the origin I would write:
orig = [0 0];
alpha_i = atan2(rz(:,2), rz(:,1));
BUT what if I want to calculate the angles just changing the origin? That is, I have for example p = [-0.5 0] and I want to calculate the angles formed by the x-axis and the points but considering a point p different from the origin. Thank you!