当前位置: 首页 > news >正文

求下列线性变换的矩阵

在这里插入图片描述

线性变换的矩阵表示

背景知识

在线性代数中,线性变换是指满足以下两个条件的变换 T:Rn→RmT: \mathbb{R}^n \to \mathbb{R}^mT:RnRm

  1. T(u+v)=T(u)+T(v)T(u+v) = T(u) + T(v)T(u+v)=T(u)+T(v)(可加性)
  2. T(cu)=cT(u)T(cu) = cT(u)T(cu)=cT(u)(齐次性)

对于任意向量 u,v∈Rnu,v \in \mathbb{R}^nu,vRn 和标量 c∈Rc \in \mathbb{R}cR

线性变换的矩阵表示:给定线性变换 T:Rn→RnT: \mathbb{R}^n \to \mathbb{R}^nT:RnRn 和标准基 {e1,e2,...,en}\{e_1, e_2, ..., e_n\}{e1,e2,...,en},变换 TTT 对应的矩阵 AAA 的第 iii 列就是 T(ei)T(e_i)T(ei) 在标准基下的坐标表示。

R2\mathbb{R}^2R2 中,标准基为:
e1=(10),e2=(01)e_1 = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad e_2 = \begin{pmatrix} 0 \\ 1 \end{pmatrix}e1=(10),e2=(01)

线性变换的矩阵表示基本原理

线性变换的矩阵表示基于一个核心思想:矩阵的列就是标准基向量经过变换后的坐标

标准基的重要性

Rn\mathbb{R}^nRn 中,标准基向量为:
e1=(10⋮0),e2=(01⋮0),…,en=(00⋮1)e_1 = \begin{pmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{pmatrix}, \quad e_2 = \begin{pmatrix} 0 \\ 1 \\ \vdots \\ 0 \end{pmatrix}, \quad \ldots, \quad e_n = \begin{pmatrix} 0 \\ 0 \\ \vdots \\ 1 \end{pmatrix}e1=100,e2=010,,en=001

这些基向量的重要性在于:

  • 任何向量 v=(x1x2⋮xn)v = \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix}v=x1x2xn 都可以表示为 v=x1e1+x2e2+⋯+xnenv = x_1e_1 + x_2e_2 + \cdots + x_ne_nv=x1e1+x2e2++xnen
  • 如果我们知道每个基向量 eie_iei 经过变换 TTT 后的结果,就能确定任意向量 vvv 的变换结果
矩阵-向量乘法的列视角

考虑矩阵 AAA 与向量 xxx 的乘法:
Ax=(a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮an1an2⋯ann)(x1x2⋮xn)=x1(a11a21⋮an1)+x2(a12a22⋮an2)+⋯+xn(a1na2n⋮ann)Ax = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix} = x_1\begin{pmatrix} a_{11} \\ a_{21} \\ \vdots \\ a_{n1} \end{pmatrix} + x_2\begin{pmatrix} a_{12} \\ a_{22} \\ \vdots \\ a_{n2} \end{pmatrix} + \cdots + x_n\begin{pmatrix} a_{1n} \\ a_{2n} \\ \vdots \\ a_{nn} \end{pmatrix}Ax=a11a21an1a12a22an2a1na2nannx1x2xn=x1a11a21an1+x2a12a22an2++xna1na2nann

这个公式表明:

  • 矩阵 AAA 的第 iii 列就是 AeiAe_iAei 的结果
  • 矩阵-向量乘法实际上是输入向量各分量与矩阵各列的线性组合

题目求解

(1) 关于 y y y 轴对称

变换规则(x,y)↦(−x,y)(x, y) \mapsto (-x, y)(x,y)(x,y)

计算标准基的变换

  • T(e1)=T(10)=(−10)=−1⋅e1+0⋅e2T(e_1) = T\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} -1 \\ 0 \end{pmatrix} = -1 \cdot e_1 + 0 \cdot e_2T(e1)=T(10)=(10)=1e1+0e2
  • T(e2)=T(01)=(01)=0⋅e1+1⋅e2T(e_2) = T\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} = 0 \cdot e_1 + 1 \cdot e_2T(e2)=T(01)=(01)=0e1+1e2

矩阵表示
A1=(−1001)A_1 = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}A1=(1001)

验证
(−1001)(xy)=(−xy)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -x \\ y \end{pmatrix}(1001)(xy)=(xy)


(2) 关于直线 y = x y = x y=x 对称

变换规则(x,y)↦(y,x)(x, y) \mapsto (y, x)(x,y)(y,x)

计算标准基的变换

  • T(e1)=T(10)=(01)=0⋅e1+1⋅e2T(e_1) = T\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} = 0 \cdot e_1 + 1 \cdot e_2T(e1)=T(10)=(01)=0e1+1e2
  • T(e2)=T(01)=(10)=1⋅e1+0⋅e2T(e_2) = T\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} = 1 \cdot e_1 + 0 \cdot e_2T(e2)=T(01)=(10)=1e1+0e2

矩阵表示
A2=(0110)A_2 = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}A2=(0110)

验证
(0110)(xy)=(yx)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} y \\ x \end{pmatrix}(0110)(xy)=(yx)


(3) 关于直线 y = − x y = -x y=x 对称

变换规则(x,y)↦(−y,−x)(x, y) \mapsto (-y, -x)(x,y)(y,x)

计算标准基的变换

  • T(e1)=T(10)=(0−1)=0⋅e1−1⋅e2T(e_1) = T\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ -1 \end{pmatrix} = 0 \cdot e_1 - 1 \cdot e_2T(e1)=T(10)=(01)=0e11e2
  • T(e2)=T(01)=(−10)=−1⋅e1+0⋅e2T(e_2) = T\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} -1 \\ 0 \end{pmatrix} = -1 \cdot e_1 + 0 \cdot e_2T(e2)=T(01)=(10)=1e1+0e2

矩阵表示
A3=(0−1−10)A_3 = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}A3=(0110)

验证
(0−1−10)(xy)=(−y−x)\begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} -y \\ -x \end{pmatrix}(0110)(xy)=(yx)


图表

变换类型矩阵表示
关于 yyy 轴对称(−1001)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}(1001)
关于 y=xy = xy=x 对称(0110)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}(0110)
关于 y=−xy = -xy=x 对称(0−1−10)\begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}(0110)

运行代码可视化

python代码

import numpy as np
import matplotlib.pyplot as plt
# 设置中文字体
plt.rcParams['font.sans-serif'] = ['SimHei']  # 解决中文显示问题-设置字体为黑体
plt.rcParams['axes.unicode_minus'] = False  # 解决保存图像是负号'-'显示为方块的问题# 定义标准基向量
e1 = np.array([1, 0])
e2 = np.array([0, 1])print("标准基向量:")
print(f"e1 = {e1}")
print(f"e2 = {e2}")
print()# (1) 关于 y 轴对称的变换
def reflection_y(vec):"""关于 y 轴对称变换"""return np.array([-vec[0], vec[1]])# 计算标准基的变换结果
T_e1_y = reflection_y(e1)
T_e2_y = reflection_y(e2)# 构建变换矩阵
A_y = np.column_stack([T_e1_y, T_e2_y])
print("(1) 关于 y 轴对称的变换矩阵:")
print(A_y)# (2) 关于直线 y = x 对称的变换
def reflection_y_eq_x(vec):"""关于直线 y = x 对称变换"""return np.array([vec[1], vec[0]])# 计算标准基的变换结果
T_e1_yx = reflection_y_eq_x(e1)
T_e2_yx = reflection_y_eq_x(e2)# 构建变换矩阵
A_yx = np.column_stack([T_e1_yx, T_e2_yx])
print("(2) 关于直线 y = x 对称的变换矩阵:")
print(A_yx)# (3) 关于直线 y = -x 对称的变换
def reflection_y_eq_minus_x(vec):"""关于直线 y = -x 对称变换"""return np.array([-vec[1], -vec[0]])# 计算标准基的变换结果
T_e1_ymx = reflection_y_eq_minus_x(e1)
T_e2_ymx = reflection_y_eq_minus_x(e2)# 构建变换矩阵
A_ymx = np.column_stack([T_e1_ymx, T_e2_ymx])
print("(3) 关于直线 y = -x 对称的变换矩阵:")
print(A_ymx)# 可视化变换结果
def plot_transformations():"""绘制变换效果图"""fig, axes = plt.subplots(1, 3, figsize=(15, 5))# 原始向量original = np.array([2, 1])# (1) 关于 y 轴对称axes[0].quiver(0, 0, original[0], original[1], angles='xy', scale_units='xy', scale=1, color='blue',label='原始向量')transformed = A_y @ originalaxes[0].quiver(0, 0, transformed[0], transformed[1], angles='xy', scale_units='xy', scale=1, color='red',label='变换后')axes[0].axvline(x=0, color='gray', linestyle='--', alpha=0.7)axes[0].set_xlim(-3, 3)axes[0].set_ylim(-2, 2)axes[0].set_aspect('equal')axes[0].set_title('关于 y 轴对称')axes[0].legend()axes[0].grid(True)# (2) 关于直线 y = x 对称axes[1].quiver(0, 0, original[0], original[1], angles='xy', scale_units='xy', scale=1, color='blue',label='原始向量')transformed = A_yx @ originalaxes[1].quiver(0, 0, transformed[0], transformed[1], angles='xy', scale_units='xy', scale=1, color='red',label='变换后')x = np.linspace(-3, 3, 100)axes[1].plot(x, x, 'gray', linestyle='--', alpha=0.7)axes[1].set_xlim(-3, 3)axes[1].set_ylim(-2, 2)axes[1].set_aspect('equal')axes[1].set_title('关于 y = x 对称')axes[1].legend()axes[1].grid(True)# (3) 关于直线 y = -x 对称axes[2].quiver(0, 0, original[0], original[1], angles='xy', scale_units='xy', scale=1, color='blue',label='原始向量')transformed = A_ymx @ originalaxes[2].quiver(0, 0, transformed[0], transformed[1], angles='xy', scale_units='xy', scale=1, color='red',label='变换后')axes[2].plot(x, -x, 'gray', linestyle='--', alpha=0.7)axes[2].set_xlim(-3, 3)axes[2].set_ylim(-2, 2)axes[2].set_aspect('equal')axes[2].set_title('关于 y = -x 对称')axes[2].legend()axes[2].grid(True)plt.tight_layout()plt.show()# 执行可视化
plot_transformations()

可视化

在这里插入图片描述

http://www.dtcms.com/a/520324.html

相关文章:

  • iOS 打包 IPA 全流程详解,签名配置、工具选择与跨平台上传实战指南
  • 前端代码规范:husky+ lint-staged+pre-commit
  • 房地产公司网站源码图片数量 wordpress
  • Qt-UDP
  • Ethernet/ip 转 Modbus RTU 驱动,罗克韦尔 PLC 与华为逆变器打造光伏电站智能监控典范
  • 与创新者同频!与FlagOS共赴开源之约
  • 【C++学习】函数及分文件编写
  • 网站免费推广计划新闻视频网站开发
  • 推进网站集约化建设的作用易企秀h5页面怎么制作
  • 2025年--Lc209- 75. 颜色分类(排序)--Java版
  • 郑州网站维护推广西安网站建设管理
  • 为 Claude Code CLI 提供美观且高度可定制的状态行,具有powerline support, themes, and more.
  • 第156期 适用于RAG的最佳开源嵌入模型 多语言自然语言处理及阿拉伯语文本的高性能开源嵌入模型
  • 公司网站建设需要哪些方面土地流转网站开发
  • Grafana监控可视化
  • GEO数据分析与效果归因:GEO 效果的多维度分析框架
  • 31.stream数据类型应用
  • 蓝牙协议6.1
  • 微服务中的服务熔断、降级与限流
  • 查网站的建站系统百度搜索网站图片
  • 网站界面风格设计描述网站类网站开发犯罪吗
  • 新站点seo联系方式设计工作室网站首页
  • Adobe Lightroom Classic 2025解锁版 (专业照片管理)
  • univla复现libero
  • kubernets的pod管理
  • 14、【Ubuntu】【VSCode】VSCode 断联问题分析:hostname(二)
  • Java 堆排序(Heap Sort)详解教程
  • 软件设计师知识点总结:操作系统
  • 黄岩路桥网站设计网站流量提升方案
  • 设计师网站欣赏店铺只做商品展示网站怎么做