Finding the angle of rotation given the slope of the line connecting two rotated points.

21 views (last 30 days)
I am trying to apply certain special affine transformations to sets in 2-space. One of the simplest problems I am working with: I have original points (3,8) and (6,1) that lie on a line with slope m = -7/3 . I would like to rotate these two points (counterclockwise through the origin) so that the rotated points lie on a new line with slope m = -1 .
This is easy if one can find the angle of rotation but I am having trouble even with mupad. I tried rotating the original two points with the 2x2 matrix
cos(w) -sin(w)
sin(w) cos(w)
and then solving for w in mupad but the output (right below) appears to show that the set of rotation angles are all complex valued which seems wrong.
(PI*k - (ln(21/29 + (20*I)/29)*I)/2, k, Z_)
If I can find a real value for w in either radians or degrees I think I can proceed. Am I right that this problem has an easy solution I am simply missing?

Accepted Answer

Matt J
Matt J on 30 Jun 2014
Edited: Matt J on 30 Jun 2014
The rotation angle is easy to calculate,
w = atand(-1) - atand(-7/3) %clockwise rotation angle in degrees
It depends only on the slopes, not on where the center of rotation is.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!