A square matrix A∈Rn×n is an orthogonal matrix if and only if its columns are orthonormal so that
AAT=ATA=I which implies that A−1=AT
Transformations by orthogonal matrices are special because the length of a vector x is not changed when transforming it using an orthogonal matrix A.For the dot product we obtain
‖Ax‖2=(Ax)T(Ax)=xTATAx=xTIx=xTx=‖x‖2
Moreover the angle between two vectors x,y is unchanged when transforming both of them using an orthogonal matrix A
cosω=(Ax)T(Ay)‖Ax‖‖Ay‖=xTATAy√xTATAxyTATAy=xTy‖x‖‖y‖
This means that orthogonal matrices A with AT=A−1 preserve both angles and distances.
Eg: The rotation matrix
[cosθ−sinθsinθcosθ]import numpy as np
B=np.array([[1/np.sqrt(2),1/np.sqrt(2)],[1/np.sqrt(2),-1/np.sqrt(2)]])
print("Orthogonal Matrix B")
print(B)
print("B Inverse")
print(np.linalg.inv(B))
print("B Transpose")
print(B.T)
print("B x B.T= I")
print(B.dot(B.T))
Orthogonal Matrix B
[[ 0.70710678 0.70710678]
[ 0.70710678 -0.70710678]]
B Inverse
[[ 0.70710678 0.70710678]
[ 0.70710678 -0.70710678]]
B Transpose
[[ 0.70710678 0.70710678]
[ 0.70710678 -0.70710678]]
B x B.T= I
[[1. 0.]
[0. 1.]]
rotate the vector
x1=[23]
x2=[0−1] by 30∘
[√32−1/21/2√32].[23]=12[2√3−32+3√3]
[√32−1/21/2√32].[0−1]=12[1−√3]
Comments
Post a Comment