MATHEMATICS

Matrices

Article by:
Date Published:
Last Modified:

Dot Product

Numpy

The dot product of arrays of vectors can be calculated using Numpy with:

import numpy as np
a = np.array([[1, 1, 1], [2, 2, 2]])
b = np.array([[1, 2, 3], [4, 5, 6]])
np.sum(a*b, axis=1)

Projection

The dot product can be used to calculate the projection of a vector onto an axis in 3D space.


Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Related Content:

Tags

comments powered by Disqus
Page contents: