Skip to main content

linear algebra

Project description

#懒得搞标题了

不是?!

是谁给我加的标题?!

(无人在意)

话归正传,该介绍模块了

这个模块讲的是线性代数但没图像(本来想制作的但因电脑用不了自解压选压缩文件(exe文件) 所以用的便携版可嵌入式压缩包,没有turtle模块)

如果你在使用过程中引发 FloatingPointError 属于正常现象,因为我恶趣味的把所有错误改成了 FloatingPointError (奸笑)

核心功能

1、二维向量(Vector 类)

初始化:通过 Vector(x, y) 创建二维向量

基本运算:支持加减(向量间)、乘除(与标量)、模长计算(mode()/abs)、归一化(normalize())等

比较运算:基于向量模长进行大小比较(</<=/>/>=),支持相等性判断(==/!=)

辅助方法:提供 ceil()/floor() 取整、迭代器(可直接解包为 x, y)等功能

常量定义:base_vector_2D_i((1,0))和 base_vector_2D_j((0,1))作为二维基向量

2、二维矩阵(Matrix 类)

初始化:通过两个二维向量创建 2x2 矩阵,默认初始化为单位矩阵

核心运算:支持矩阵乘法(mul)、行列式计算(det())、转置(transpose())等

比较运算:基于行列式值进行大小比较和相等性判断

构造函数:matrix_2D() 支持通过两个向量或四个数字元组创建矩阵

3、三维向量(Vectors 类)

初始化:通过 Vectors(x, y, z) 创建三维向量

功能:类似二维向量,扩展至三维空间,支持三维向量的加减、标量乘除、模长、归一化等

常量定义:base_vector_3D_i((1,0,0))、base_vector_3D_j((0,1,0))、base_vector_3D_k((0,0,1))作为三维基向量

4、三维矩阵(Matrixes 类)

初始化:通过三个三维向量创建 3x3 矩阵,默认初始化为单位矩阵

核心运算:支持矩阵乘法、行列式计算(det())、转置(transpose())等

构造函数:matrix_3D() 支持通过三个向量或九个数字元组创建矩阵

5、工具函数

点积计算:dot_2D()(二维)、dot_3D()(三维)

叉积计算:cross_2D()(二维)、cross_3D()(三维)

向量变换:change_vector_2D()(二维向量与矩阵相乘)、change_vector_3D()(三维向量与矩阵相乘)

快捷创建:vector_2D()、vector_3D() 用于快速实例化向量

6、注意事项

不支持一下运算

单目运算:取正(+some_object,__ pos __),取反(-some_object, __ neg __),按位取反(~some_object, __ invert __)

双目运算:左移(<<),右移(>>),按位与(&),按位或(|),按位异或(^)

增强运算赋值:+=,-=,*=,/=,//=,%=,**=,<<=,>>=,&=,|=,^=

作者只是中学生,部分技能未解锁,please多多支持!!!!!!!!

It is in Chinese.(coding: UTF-8)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

the_linear_algebra-0.0rc31415926.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

the_linear_algebra-0.0rc31415926-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file the_linear_algebra-0.0rc31415926.tar.gz.

File metadata

File hashes

Hashes for the_linear_algebra-0.0rc31415926.tar.gz
Algorithm Hash digest
SHA256 ac0d14ec61dc68578694ddbaae2a8e15c0f513d9373379a08d1195e94b5fb95b
MD5 adff2dda938e0396b28ae4c58e1993db
BLAKE2b-256 bdf37ef1a9057908671f996a5b21e30501583a2da06c049085f5fe499d5097e3

See more details on using hashes here.

File details

Details for the file the_linear_algebra-0.0rc31415926-py3-none-any.whl.

File metadata

File hashes

Hashes for the_linear_algebra-0.0rc31415926-py3-none-any.whl
Algorithm Hash digest
SHA256 41cec856c543fe37341c8467a81c2e334723cdc8105505c61f8ca7dda17a7b6a
MD5 28894efb2e70adde71f57b38f50d5e36
BLAKE2b-256 dec473d6bc8cdd1aba4e5b915cef23ecf795482ba4af67d9c8524f62162450cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page