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.0rc1.tar.gz (7.3 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.0rc1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: the_linear_algebra-0.0rc1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.14.0rc1

File hashes

Hashes for the_linear_algebra-0.0rc1.tar.gz
Algorithm Hash digest
SHA256 35b426c4bc9757335f3fa63f71337419398cf8644bac6205942663ec6097cf1f
MD5 c215d5d5965d203426464cb57d157971
BLAKE2b-256 e553698e9f9e3353e9e855fc2101a654530c08b9606e50157e86ad91518c053c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for the_linear_algebra-0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e5533b26568e4c05aa7e9403df9acbc96bc405097c05b24853228f43bb5a011
MD5 ab54df1358c9750501f58805d52efdf7
BLAKE2b-256 6e320c3d7049cfcda2cea810fc7de9c58bd2879e7103892d4fb9231f668478cb

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