矩阵变换

矩阵基本运算

矩阵加法

矩阵的加法满足下列运算律(A,B,C都是同型矩阵):

A + B = B + A
(A + B) + C = A + (B + C)

应该注意的是只有同型矩阵之间才可以进行加法

矩阵减法

29866996300c71eacf9fcc9ce431d54d.png

矩阵数乘

51d9aec131091a9ae609f2a75f4456ea.png

数乘满足运算律

0f2def2c8812ee7c6cd14639e1a9331a.png
29e85fb07d671511cc146aed35cfa8f7.png
31f744ef7611a1a0e8f6a0254f98aa4b.png
96ceaf2f2dc955e0d370051a59e58773.png

矩阵转置

2685844974934b6df11d96fb6aee18b2.png

转置满足运算律

0678abfccd945f6e2b14bd3680a1b6b5.png
e0af29f89d77bb021030e2e70acf8d05.png
67b0dba9aff2c62aed6a91674e766f19.png

共轭

矩阵的共轭定义为: 2c17e8b4a0b7cd78b6ef18c4e2a65616.png
 .一个2×2复数矩阵的共轭(实部不变,虚部取负)

6d1966a03d3e5bce9ff45b3e0905ad84.png
ff25aee1cd49bbc5e9cc08eb1e8e01a8.png

共轭转置

矩阵的共轭转置定义为: 239f502a3b857997211ed525da2dcc87.png
 ,也可以写为: da0e955cfa276eb747d253a552c6e403.png
 或者写为 047027e330df927ea79530406a866b1b.png
 。一个2×2复数矩阵的共轭转置如下所示:

6d1966a03d3e5bce9ff45b3e0905ad84.png
993bf5b07b399ca5841aeff06e97c5bc.png

矩阵乘法

两个矩阵的乘法仅当第一个矩阵A的列数和另一个矩阵B的行数相等时才能定义。如A是m×n矩阵和B是n×p矩阵,它们的乘积C是一个m×p矩阵 78fad0b6eda148d59f07c1c4dd23d951.png
 ,它的一个元素

46c2f2f94f11fcf165b6ea7adcaca6c6.png

并将此乘积记为: c1143fad2d8864643f3f20e8b397d29c.png

矩阵乘法运算律

结合律: 2d1366f55bed3bd7ba644ba4d84c1c22.png

左分配律: c5910d32c863ebdb97dc142bd0801883.png

右分配律: 615eec03eea818dff0c8542d7862007a.png

矩阵乘法不满足交换律。

矩阵变换

位移

import matplotlib.pyplot as plt
import numpy as np

points = np.array([
    [0,0],
    [0,5],
    [3,5],
    [3,4],
    [1,4],
    [1,3],
    [2,3],
    [2,2],
    [1,2],
    [1,0],
    [0,0]
])

matrix = np.array([2,0])
newpoints = points + matrix

plt.plot(points[:,0],points[:,1])
plt.plot(newpoints[:,0],newpoints[:,1])
plt.xlim(-10,10)
plt.ylim(-10,10)
plt.show()

旋转

import matplotlib.pyplot as plt
import numpy as np

points = np.array([
    [0,0],
    [0,5],
    [3,5],
    [3,4],
    [1,4],
    [1,3],
    [2,3],
    [2,2],
    [1,2],
    [1,0],
    [0,0]
])

matrix = np.array([
    [1,0],
    [0,-1]
])

newpoints = np.dot(points,matrix.T)
plt.plot(points[:,0],points[:,1])
plt.plot(newpoints[:,0],newpoints[:,1])
plt.xlim(-10,10)
plt.ylim(-10,10)
plt.show()

缩放

import matplotlib.pyplot as plt
import numpy as np

points = np.array([
    [0,0],
    [0,5],
    [3,5],
    [3,4],
    [1,4],
    [1,3],
    [2,3],
    [2,2],
    [1,2],
    [1,0],
    [0,0]
])

matrix = np.array([
    [2,0],
    [0,1]
])

newpoints = np.dot(points,matrix.T)
plt.plot(points[:,0],points[:,1])
plt.plot(newpoints[:,0],newpoints[:,1])
plt.xlim(-10,10)
plt.ylim(-10,10)
plt.show()
posted @ 2019-07-30 21:58  pluscat  阅读(1034)  评论(0编辑  收藏  举报