当前位置:网站首页>第5章相似矩阵及二次型(4)
第5章相似矩阵及二次型(4)
2022-08-10 10:32:00 【伊伊_f】
from sympy.matrices import *
from sympy import symbols
一.向量的内积,长度和正交性
1.向量的内积
a1,a2,a3=symbols('a1,a2,a3')
b1,b2,b3=symbols('b1,b2,b3')
a=Matrix([a1,a2,a3])
b=Matrix([b1,b2,b3])
a.dot(b)
![]()
2.向量的长度(模)
a.norm()
3.向量的夹角
a1,a2,a3=symbols('a1,a2,a3')
b1,b2,b3=symbols('b1,b2,b3')
a=Matrix([a1,a2,a3])
b=Matrix([b1,b2,b3])
ab_=a.dot(b)
a_=a.norm()
b_=b.norm()
cosab=ab_/(a_*b_)
cosab
4.向量正交
a1,a2,a3=symbols('a1,a2,a3')
b1,b2,b3=symbols('b1,b2,b3')
a=Matrix([a1,a2,a3])
b=Matrix([b1,b2,b3])
a.cross(b) #返回与a,b向量都相交的向量
5.向量的单位化(单位向量)
a1,a2,a3=symbols('a1,a2,a3')
b1,b2,b3=symbols('b1,b2,b3')
a=Matrix([a1,a2,a3])
b=Matrix([b1,b2,b3])
a.normalized() #向量除以模
6.投影向量
a1,a2,a3=symbols('a1,a2,a3')
b1,b2,b3=symbols('b1,b2,b3')
a=Matrix([a1,a2,a3])
b=Matrix([b1,b2,b3])
a.project(b) #向量a在b中的投影向量
7.正交矩阵
若矩阵A的 逆矩阵等于其转置矩阵A.inv=A.T 或者A*A.T=E,则称A为正交矩阵.
a1,a2,a3=symbols('a1,a2,a3')
b1,b2,b3=symbols('b1,b2,b3')
c1,c2,c3=symbols('c1,c2,c3')
I=[Matrix([1,2,-1]),Matrix([-1,3,1]),Matrix([4,1,0])]
O=GramSchmidt(I,True)
O
二.方阵的特征值和特征向量
1.特征值
A=Matrix([[1,0,2],[0,3,0],[2,0,1]])
A.eigenvals()
2.特征向量
A=Matrix([[1,0,2],[0,3,0],[2,0,1]])
A.eigenvects()
三.相似矩阵
1.矩阵相似对角化
A=Matrix([[1,0,2],[0,3,0],[2,0,1]])
A.jordan_form() #返回两个矩阵: P对角化矩阵和对角矩阵A_
或者A.diagonalize()
2.矩阵的LU分解
A=Matrix([[1,3,4,6],[3,5,7,8],[9,2,1,6],[3,4,5,7]])
A.LUdecomposition() #返回下三角和上三角矩阵
边栏推荐
- 商城限时秒杀功能系统
- Dalian University of Technology & Pengcheng & UAE propose a mixed-scale triple network ZoomNet for camouflaged target detection, with SOTA performance!
- Situation丨The intrusion of hackers intensifies, and the shooting range sets up a "defense shield" for network security
- Summary of whitespace, space and escape characters in C language
- STM32封装ESP8266一键配置函数:实现实现AP模式和STA模式切换、服务器与客户端创建
- 【知识论概念】《理由论的进展》鲁汶大学2022最新220页博士论文
- 14道高频手写JS面试题及答案,巩固你的JS基础
- ES复杂操作搜索
- How can an organization judge the success of data governance?
- 3D rotating text animation js special effects
猜你喜欢

bus事件总线 使用

Redis(三)——配置文件详解、发布和订阅、新数据类型

干货!ASSANet:让PointNet++更快更强

金九银十跳槽旺季:阿里、百度、京东、美团等技术面试题及答案

开发模式对测试的影响

Taro小程序跨端开发入门实战

STM32 encapsulation ESP8266 a key configuration function: implementations of AP mode and the STA mode switch, server and the client to create

【知识论概念】《理由论的进展》鲁汶大学2022最新220页博士论文

Text selection rounded style border-radius

快速上手,征服三种不同分布式架构调用方案
随机推荐
C语言题解:倒置字符串
Regarding the missing json converter, the error message is: No converter found for return value of type
这些年我开源的几个小项目
What is an abstract class
Research on motion capture system for indoor combined positioning technology
「第二部:容器和微服务架构」(1) 基于容器应用架构设计原则
Flutter实战-请求封装(五)之Isolate线程改造
用proteus直接仿真stm32-可以完全丢弃编程器
EasyCVR级联时,修改下级平台名称将不同步至上级平台
js对象转FormData对象(一般用于上传)
Behind iFLYTEK's translation machine stealing the spotlight, cross-language communication has entered a new era
短视频软件开发——平台同质化如何破局
ECCV 2022 | 视频理解新框架X-CLIP:仅用微调的成本,达到预训练的全能
CodeChef STRMRG String Merging (dp)
js猜拳小游戏源码
[Azure Cloud] What is the difference between a service endpoint and a private link?point of view (1)
Network Security Note 6 - Digital Certificates and Public Key Infrastructure
C#List的使用以及Linq的使用
用.bat文件做Airtest脚本的多设备批量运行
TCP/IP笔记