日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

线性代数向量乘法_标量乘法属性1 | 使用Python的线性代数

發布時間:2025/3/11 python 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 线性代数向量乘法_标量乘法属性1 | 使用Python的线性代数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

線性代數向量乘法

Prerequisite: Linear Algebra | Defining a Vector

先決條件: 線性代數| 定義向量

Linear algebra is the branch of mathematics concerning linear equations by using vector spaces and through matrices. In other words, a vector is a matrix in n-dimensional space with only one column. In a scalar product, each component of the vector is multiplied by the same scalar value. As a result, the vector's length is increased by a scalar value.

線性代數是使用向量空間和矩陣的線性方程組的數學分支。 換句話說,向量是n維空間中只有一列的矩陣。 在標量積中,向量的每個分量都乘以相同的標量值。 結果,向量的長度增加了一個標量值。

For example: Let a vector a = [4, 9, 7], this is a 3-dimensional vector (x, y, and z)

例如:讓向量a = [4、9、7],這是3維向量(x,y和z)

So, a scalar product will be given as?b = c*a

因此,標量積將給出為b = c * a

Where c is a constant scalar value (from the set of all real numbers R). The length vector b is c times the length of vector a. This scalar, multiplication follows a property shown below:

其中c是常數標量值(來自所有實數R的集合)。 長度矢量b是向量a的長度c倍。 此標量乘法遵循以下屬性:

Where A and B are two vectors. The python code aims to evaluate the right-hand side and left-hand side for proving the scalar property.

其中AB是兩個向量。 python代碼旨在評估右側和左側以證明標量屬性。

標量乘法屬性的Python代碼 (Python code for Scalar Multiplication Property)

# Vectors in Linear Algebra Sequnce A = [3, 5, -5, 8] B = [7 , 7 , 7 , 7] print("Vector A = ", A) print("Vector B = ", B)C = int(input("Enter the value of scalar multiplier: "))# defining a function for scalar multiplication def scalar(C, a):b = []for i in range(len(a)):b.append(C*a[i])return b # defining a function for addition def add(a,b):c = []for i in range(len(a)):c.append(a[i]+b[i])return c# RHS ss = add(A,B) print("Vector C(A + B) = ", scalar(C,ss))# LHS An = scalar(C, A) Bn = scalar(C, B) print("Vector (CA + CB) = ", add(An,Bn))print('---Both are same and therefore,') print('the scalar property in vectors satisfies') print('this property---')

Output

輸出量

Vector A = [3, 5, -5, 8] Vector B = [7, 7, 7, 7] Enter the value of scalar multiplier: 3 Vector C(A + B) = [30, 36, 6, 45] Vector (CA + CB) = [30, 36, 6, 45] ---Both are same and therefore, the scalar property in vectors satisfies this property---

翻譯自: https://www.includehelp.com/python/scalar-multiplication-property-1.aspx

線性代數向量乘法

總結

以上是生活随笔為你收集整理的线性代数向量乘法_标量乘法属性1 | 使用Python的线性代数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。