20191013, 11:16  #1 
Jul 2014
3·149 Posts 
rotating a shear
Hi,
my nephew recently asked me a question about a 2 by 2 matrix with real entries. The question was, what is the shear factor of the matrix \(\begin{bmatrix} 1 & 1 \\ 4 & 3 \end{bmatrix}\). We worked out that it was 5 by taking the coordinates of a point transformed by the matrix, and dividing the distance the point moves due to the shear by the perpendicular distance of the point from the invariant line of the shear which was \(y=2x\). My nephew thought that there must be an easier way which got me thinking. AFAIK, an \(\textbf{xshear}\) is a shear with matrix \(\begin{bmatrix} 1 & a \\ 0 & 1 \end{bmatrix}\), for which a is the shear factor. The shear of the question is like an xshear except the line of shear is not the xaxis but the line \(y=2x\). So I thought that the shear transformation could be composed with a rotation which effectively renders it a shear about the xaxis and then the shear factor would be the entry in row 1, column 2. So I worked out the rotation matrix \(R_{\theta}\)using the triangle with vertices \((0,0), (0, 1) \text{ and } (1,2)\) to get the angle of rotation between the xaxis and the invariant line \(\theta\). The matrix I got was \(\begin{bmatrix} \frac{1}{\sqrt{5}} & \frac{2}{\sqrt{5}} \\ \frac{2}{\sqrt{5}} & \frac{1}{\sqrt{5}} \end{bmatrix}\) The trouble if I multiply the shear matrix on the left by the rotation matrix I get \(\begin{bmatrix} \frac{9}{\sqrt{5}} & \frac{7}{\sqrt{5}} \\ \frac{2}{\sqrt{5}} & \frac{1}{\sqrt{5}} \end{bmatrix}\) This isn't what I expected. Can someone explain how to do the matrix multiplication to get an xshear with shear factor 5. 
20191013, 13:18  #2 
Dec 2012
The Netherlands
2×3×271 Posts 
Let t be the (smaller) angle between the line y=2x and the xaxis.
You want to rotate clockwise through the angle t, then perform the shear with the xaxis as its invariant line, then rotate anticlockwise through the angle t, so that the combined effect is to leave the line y=2x invariant. 
20191013, 13:37  #3 
Jul 2014
3×149 Posts 
I see
Thanks. So if I didn't know previously what the shear factor is I need to find the angle t and then solve
\(R_{t}\begin{bmatrix} 1 & a \\ 0 & 1\end{bmatrix}R_{t}=A\) to get the value of a. Last fiddled with by wildrabbitt on 20191013 at 13:45 
20191013, 13:42  #4  
Dec 2012
The Netherlands
2×3×271 Posts 
Quote:
\[ \left(\begin{array}{cc} 1 & a \\ 0 & 1 \end{array}\right) =R_{t}AR_t \] 

20191013, 13:46  #5 
Jul 2014
447_{10} Posts 
Brilliant. Thanks very much Nick.

20191014, 16:26  #6 
Feb 2017
Nowhere
4342_{10} Posts 
I tried the following: I obtained the eigenvectors of the matrix, which I called A. There was (up to scalar multiples) only one. Luckily, the eigenvalue is 1. I then used the obvious orthogonal vector of the same magnitude to create a matrix for a similarity transformation which expresses A in a coordinate system with the eigenvector pointing along one of the coordinate axes.
Because the vectors in the transformation matrix are (by construction) orthogonal and of the same magnitude, the matrix is, up to a nonzero scalar factor, an orthogonal matrix (a matrix that defines a rotation and/or a reflection). Since the similarity transformation involves multiplying by the matrix and its inverse, the scalar factor cancels out, so you can avoid expressions with messy square roots. Since I can never remember which order to multiply in  Inverse first? Matrix first?  the first time I tried I did it the wrong way, and got a messy, obviously wrong answer. That told me I'd gotten the order of multiplication wrong, so I did it the other way. Code:
? A=[1,1;4,3] %1 = [1 1] [4 3] ? v=mateigen(A) %2 = [1/2] [1] ? B=concat(v,[1,1/2]~) %3 = [1/2 1] [1 1/2] ? B*A*B^(1) %4 = [17/5 9/5] [16/5 7/5] ? B^(1)*A*B %5 = [1 5] [0 1] Last fiddled with by Dr Sardonicus on 20191014 at 16:27 Reason: clarification 
20191014, 16:43  #7  
Jul 2014
447_{10} Posts 
Thanks for all that.
Quote:
Can you tell me how you did that, giving the actual matrix? 

20191015, 01:44  #8 
Romulan Interpreter
Jun 2011
Thailand
5^{2}·7·53 Posts 
This series about linear algebra may help. What you ask for is in the fourth video called matrix multiplication, and also the thirteenth video, called changing of the base, but to understand better you have to watch all the series.
Last fiddled with by LaurV on 20191015 at 03:49 
20191015, 10:03  #9 
Jul 2014
3×149 Posts 
Thanks.

20191015, 13:11  #10  
Feb 2017
Nowhere
4342_{10} Posts 
Quote:
M = [1,a;0,1] has characteristic polynomial x^2  2*x + 1 = (x1)^2. The trace is 2 and the determinant is 1. Therefore any matrix that is similar to a shear matrix has characteristic polynomial (x1)^2, trace 2, and determinant 1. Next, a rotation is accomplished by a similarity transformation using an orthogonal matrix with determinant +1. An orthogonal matrix is a matrix whose inverse is equal to its transpose. It follows from this definition that a matrix is orthogonal when its rows (or its columns) are mutually orthogonal vectors of magnitude 1. Luckily, a similarity transformation is unaffected if B is multiplied by a nonzero scalar factor. So as long as the columns (or rows) of B are mutually orthogonal and all have the same magnitude, the similarity transformation gives the same result as if B were orthogonal. Now, where in the blue tunket do eigenvectors come from? Well, if A is an nxn matrix, the (nonzero) nx1 vector v is an eigenvector of A if A*v = k*v for some scalar k. The scalar k is called an eigenvalue of A. If f(x) is the characteristic polynomial of A, then f(k) = 0 [and, if f(k) = 0, then k is an eigenvalue of A.] So, suppose v is an eigenvector of A, and A*v = k*v for a scalar k. Suppose B is an invertible nxn matrix having v as its first column. We compute the first column of B^(1)*A*B as follows (remember, matrix multiplication is associative). The first column of A*B is A*v, which is kv. So the first column of B^(1)*A*B is B^(1)*kv = kB^(1)*v (because k is a scalar factor). Now v is the first column of B, so B^(1)*v = [1;0;0;...;0], the column with 1 in the first row and 0 in all the other rows. So, the first column of B^(1)*A*B is [k;0;0...;0], the column with the eigenvalue k in the first row, and 0's everywhere else. (If you had another eigenvalue k2, with eigenvector w, linearly independent from v, and used it in the second column of B, then the same rigamarole shows that the second column of B^(1)*A*B would then be [0;k2;0;0;...;0], and so on.) So, if you have real eigenvalues, and use their eigenvectors as the initial columns of an invertible matrix B, you can at least partially "diagonalize" the matrix A by a similarity transformation. Hey  this is great! By going through this carefully, which I haven't done in at least 40 years, I think I'll be able to remember it again! Now, in the case at hand, A = [1,1;4,3] is 2x2, and its characteristic polynomial is (x1)^2, so there is a single real eigenvalue 1, which is repeated. There is, up to scalar multiples, a single eigenvector. The one PariGP spit out was [1/2;1]. The scalar multiple [1;2] would work just as well. You can check that A*v = v. Now, for this A, we're out of eigenvectors. We can use any vector we like (other than a scalar multiple of v) for the second column of B, and we will be guaranteed that the first column of B^(1)*A*B will be [1;0]. In order for the transformation to act like an orthogonal transformation, we need a vector that is orthogonal to v, and has the same magnitude. No problem! If v = [a;b] is a nonzero 2x1 vector, the vector w = [b;a] fills the bill. Even better, the matrix B = [a,b;b,a] has positive determinant, so the "normalized" orthogonal matrix has determinant +1, so is a rotation matrix. Here, then, with A = [1,1;4,3] the matrix B = [1,2;2,1] gives a similarity transformation identical to a rotation, and transforms A into a matrix with first column [1;0] and (since the determinant remains 1) 2,2 entry equal to 1. 

20191015, 19:11  #11 
Jul 2014
677_{8} Posts 
Thanks very much. I understand now.
Am I write in thinking that this method would work for any shear? Last fiddled with by wildrabbitt on 20191015 at 19:11 Reason: forgot the question mark 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Rotating cylinder  davieddy  Puzzles  7  20080409 01:12 
Rotating the Initial Start Value Of a LL Test  dave_0273  Math  9  20040825 18:24 