向量 vextors是一个Python库,用于处理R ^ N上向量之间的基本操作 安装 使用软件包管理器安装vextor。 pip install vextors 用法 from vextors import Vector v1 = Vector ([ 1 , 2 , 3 ]) # defines a three-dim vector v2 = Vector ([ 4 , 5 , 6 ]) v1 . lenght # returns the lenght of the vector v1 . dot ( v2 ) # returns the scalar multiplication of the two vectors v1 . cross ( v2 ) # returns the cross product of the two vectors ( v1 x v2 ) v1 . di