# Dot product (dot)

Dot product of two vectors, or product of two matrices.

## How to write it

### dot(a, b)

**a**

A vector or a matrix. Takes a list, or a matrix, written as a list of rows.

**b**

A vector or a matrix. Takes a list, or a matrix, written as a list of rows.

## Examples

- $\displaystyle \left[ 1, 2, 3 \right] \cdot \left[ 4, 5, 6 \right] = 32$

  `dot([1, 2, 3], [4, 5, 6])`

  In the solver, `dot([1, 2, 3], [4, 5, 6])` gives `32`.

  [Open in the solver](https://hilberon.com/?q=dot%28%5B1%2C%202%2C%203%5D%2C%20%5B4%2C%205%2C%206%5D%29)
- $\displaystyle \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \cdot \left[ 1, 1 \right] = \left[ 3, 7 \right]$

  `dot([[1, 2], [3, 4]], [1, 1])`

  In the solver, `dot([[1, 2], [3, 4]], [1, 1])` gives `[3, 7]`.

  [Open in the solver](https://hilberon.com/?q=dot%28%5B%5B1%2C%202%5D%2C%20%5B3%2C%204%5D%5D%2C%20%5B1%2C%201%5D%29)

## Related functions

- [eigensystem](https://hilberon.com/library/eigensystem)

  Eigenvalues and eigenvectors of a square matrix together: the values, then the vectors.
- [diagonal_matrix](https://hilberon.com/library/diagonal_matrix)

  A matrix with the given list on its diagonal and zeros elsewhere.
- [eigenvalues](https://hilberon.com/library/eigenvalues)

  Eigenvalues of a square matrix.
- [diagonal](https://hilberon.com/library/diagonal)

  The diagonal of a matrix, as a list.
- [eigenvectors](https://hilberon.com/library/eigenvectors)

  Eigenvectors of a square matrix, one for each eigenvalue.
- [det](https://hilberon.com/library/det)

  Determinant of a square matrix.

---
Source: https://hilberon.com/library/dot
