点积:在数学中,数量积(dot product; scalar product,也称为点积)是接受在实数R上的两个向量并返回一个实数值标量的二元运算。它是欧几里得空间的标准内积。
两个向量a = [a1, a2,…, an]和b = [b1, b2,…, bn]的点积定义为:
a·b=a1b1+a2b2+……+anbn。
设A为 m x p 的矩阵,B为 p x n 的矩阵,那么称 m x n 的矩阵C为矩阵A与B的乘积,记作 C = AB ,其中矩阵中的第 i 行第 j 列元素可以表示为:
例子:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
In [1]: import numpy as np In [2]: a = 2 In [3]: b = 3 In [4]: np.dot(a,b) Out[4]: 6 In [5]: a = [3, 4] In [6]: b = [5, 6] In [7]: np.dot(a,b) Out[7]: 39 In [8]: a = [[1,2],[3,4]] In [9]: b = [[1,2],[2,3],[3,4]] In [10]: np.dot(a,b) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-10-71281829ef00> in <module>() ----> 1 np.dot(a,b) ValueError: shapes (2,2) and (3,2) not aligned: 2 (dim 1) != 3 (dim 0) In [11]: np.dot(b,a) Out[11]: array([[ 7, 10], [11, 16], [15, 22]]) |
余弦定理(The Law of Cosines):
http://baike.baidu.com/item/%E4%BD%99%E5%BC%A6%E5%AE%9A%E7%90%86#2_1
复共轭(complex conjugate):
https://en.wikipedia.org/wiki/Complex_conjugate
Geometric representation of z and its conjugate z̅ in the complex plane. The complex conjugate is found by reflecting z across the real axis.
In mathematics, the complex conjugate of a complex number is the number with equal real part and imaginary part equal in magnitude but opposite in sign.[1][2] For example, the complex conjugate of 3 + 4i is 3 − 4i.