> A vector is an element of a vector space. Only when you choose a base for this vector space is the vector mapped to an array of numbers. Choosing two different bases will result in two different arrays of numbers for the same vector.
> A vector, e.g., $\mathbf{v} \in \mathbb{R}^n$, is a numerical entity in an $n$-dimensional space. A matrix, e.g., $\mathbf{A} \in \mathbb{R}^{m \times n}$, is a linear transformation from a $n$-dimensional to a $m$-dimensional space. In other words, if $T\left\{\cdot\right\}$ is a linear transformation, then there exists a matrix $\mathbf{A}$ such that $T\left\{\mathbf{v}\right\} = \mathbf{Av} = \mathbf{w} \in \mathbb{R}^m$.
> ...
> My definition holds only for linear algebra analysis. For multilinear algebra, a matrix (or a tensor) is a numerical entity as well as a vector.
> A row vector describes a linear map $\mathbb{R}^n→\mathbb{R}$, a column vector is, via scalar multiplication, a map $\mathbb{R}→\mathbb{R}^n$, so your distinction has a difference of zero.
\- [Vector vs Matrix](https://math.stackexchange.com/questions/1536855/can-anyone-please-explain-the-the-difference-between-a-vector-and-a-matrix) via StackExchange
> In [mathematics](https://en.wikipedia.org/wiki/Mathematics "Mathematics") and [physics](https://en.wikipedia.org/wiki/Physics "Physics"), **vector** is a term that refers colloquially to some [quantities](https://en.wikipedia.org/wiki/Physical_quantity "Physical quantity") that cannot be expressed by a single number (a [scalar](https://en.wikipedia.org/wiki/Scalar_(physics) "Scalar (physics)")), or to elements of some [vector spaces](https://en.wikipedia.org/wiki/Vector_space "Vector space").
\- [Vector](<https://en.wikipedia.org/wiki/Vector_(mathematics_and_physics)>) via Wikipedia
For example, given this vector:
$\begin{bmatrix}
1 , 2 , 3
\end{bmatrix}$
Vectors are not conceptually the discrete values of `1`, `2`, and `3` that just happen to be in a sequence. Instead they imply that there is some unit or space which gives them meaning, which may radically alter how they're treated. It is almost like under the covers the vector is more like:
$
\begin{bmatrix}
1x , 2y, 3z
\end{bmatrix}
$
Where the `x`, `y`, and `z` may each indicate *entirely different units*, orthogonal dimensions, problem spaces, or otherwise that the discrete value must be treated specially from the others. This unit or space is called the basis.
See also: [[Vector Geometric Algebra]]
# Multiplying Vectors
There are several different ways to multiply vectors with each other and each strategy has their own usage. In common math notation, there is no canonical multiplication strategy for vectors in the adjacent form of $\vec a \vec b$, instead each discipline has their own default strategy.
## Dot Product
The output is a single *scalar* value rather than a new vector.
$\vec a \cdot \vec b = a_x b_x + a_y b_y + a_z b_z = c$
$\sum_{i=1}^n a_i b_i$
## Cross Product
The cross product is a product of two vectors that results in a vector perpendicular to both.
The cross product returns a *vector*, composed by rearranging the original vectors with some of their components multiplied and subtracted.
$\vec a \times \vec b = \begin{bmatrix} a_y b_z - a_z b_y \\ a_z b_x - a_x b_z \\ a_x b_y - a_y b_x \end{bmatrix} = \vec c$
The result is a vector perpendicular to both, due to the combination of units in the basis.
The cross product is a special case of the more general [[#Wedge Product]] with the units removed. This creates several problems and limitations for the dot product, but requires less context to use initially.
### Pseudovectors
Algebraically, a cross-product returns a pseudovector. Though this only works with 3D and 7D vectors. In 3D, this has the vector basis of $\begin{Bmatrix} yz,zx,yx \end{Bmatrix}$ and has the algebraic form of:$
\vec a \times \vec b
= \begin{split}
x(a_y b_z - a_z b_y) + \\
y(a_z b_x - a_x b_z) + \\
z(a_x b_y - a_y b_x)
\end{split}
= \vec c$
A pseudovector is really just a special case of a [[#Bivectors|bivector]] taken out of its context.
## 2D "Cross" Product
Essentially a standard cross product, except that the input `z` components are set to `0`.
In theory this returns a *vector* where `x` and `y` equal `0` and `z` holds our result, but in practice often only the *scalar* value of the `z` component `c` is returned.
$
\vec a \times \vec b
=
\begin{bmatrix}
a_y 0 - 0 b_y \\
0 b_x - a_x 0 \\
a_x b_y - a_y b_x
\end{bmatrix}
= \begin{bmatrix} 0 , 0 , c \end{bmatrix}$
Apparently useful in computer graphics / gamedev.
When calculated algebraically, 2D vector multiplication produces a value in the equivalent basis as complex numbers like $\begin{Bmatrix}1,xy\end{Bmatrix}$.
## Wedge Product
The wedge product AKA "exterior product" is identical to the [[#Cross Product]] but retains the units resulting in a new output basis vector with the format of $\begin{Bmatrix} yz,zx,yx \end{Bmatrix}$, and returns a [[#Bivectors|Bivector]] with the algebraic form of:
$
\vec a \wedge \vec b
= \begin{split}
yz(a_y b_z - a_z b_y) + \\
zx(a_z b_x - a_x b_z) + \\
xy(a_x b_y - a_y b_x)
\end{split}
= \vec c$
The wedge product generalizes to any number of dimensions, unlike the [[#Cross Product]].
The terms cross product and wedge product are sometimes used interchangeably, particularly if the units/basis can be ignored.
## Hadamard Product
Just multiply each component to the one that matches it and stick it back into the same slot, producing a *vector* as the result.
$
\vec a \circ \vec b
=
\begin{bmatrix}
a_x b_x \\
a_y b_y \\
a_z b_z
\end{bmatrix}
= \vec c$
Used by shader programmers.
## Geometric Product
Algebraically, this is the correct way to multiply vector.
### Quaternions
A quaterion is an extension of complex numbers with the definition:
$i^2=j^2=k^2=ijk=-1$
If one were to do a discrete algebraic multiplication of two 3D vectors, then the output would be a *quaternion* with the structure of: $\begin{Bmatrix} 1,yz,zx,yx \end{Bmatrix}$With the result formed via this algebraic equation: $
\vec a * \vec b
= \begin{split}
a_x b_x + a_y b_y + a_z b_z + \\
yz(a_y b_z - a_z b_y) + \\
zx(a_z b_x - a_x b_z) + \\
xy(a_x b_y - a_y b_x)
\end{split}
= c$
Generally a quaternion is described using the terms $\begin{Bmatrix}1,i,j,k\end{Bmatrix}$. For the purposes of vector math, a quaternion is equivalent to a 3D [[Vector Geometric Algebra#Rotor|rotor]] using the scalar plus the 3 bivectors defined above.
### Bivectors
The [[#Quaternions|Quaternion]] form of the equation is essentially just the [[#Dot Product]] plus the [[#Wedge Product]] in algebraic form. $\vec a * \vec b = \vec a \cdot \vec b + \vec a \wedge \vec b$
But we still have those pesky `yz` terms to contend with when we expand it out.
If we focus on the vector basis for 2D $\begin{Bmatrix} xy \end{Bmatrix}$ and 3D $\begin{Bmatrix} yz,zx,yx \end{Bmatrix}$ vector multiplication products we can treat each of these components as unit planes with an area of `1` (similar to the individual unit lengths of `1`). These 2D vector axis are called *bivectors*.
The resulting 3 numbers which define these properties are identical in appearance to a vector, but just simply have a different basis where each component is considered to be a 2D plane rather than a 1D point.
# Other Terms to Define
"determinant", "anti-symmetric product".
# References
```cardlink
url: https://www.youtube.com/watch?v=htYh-Tq7ZBI
title: "Why can't you multiply vectors?"
description: "..or can you? A deceptively simple question with a complex answer – come join a mathematical journey into madness and wonder, in search of answers that might..."
host: www.youtube.com
favicon: https://www.youtube.com/s/desktop/7ea5dfab/img/favicon_32x32.png
image: https://i.ytimg.com/vi/htYh-Tq7ZBI/maxresdefault.jpg
```
```cardlink
url: https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab
title: "Essence of linear algebra"
description: "A free course offering the core concept of linear algebra with a visuals-first approach."
host: www.youtube.com
favicon: https://www.youtube.com/s/desktop/81df6011/img/favicon_32x32.png
image: https://i9.ytimg.com/s_p/PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab/landscape_mqdefault.jpg?sqp=CPDh-qwGir7X7AMICOqwiNsFEAE=&rs=AOn4CLATRKoWxu2hzcJagb5-nfIzs7jMxA&v=1533155434&days_since_epoch=19732
```
- [Intro to Matrices (Khan Academy)](https://www.khanacademy.org/math/multivariable-calculus/thinking-about-multivariable-function/x786f2022:vectors-and-matrices/a/matrices--intro-mvc)
- [Vectors and Notation (Khan Academy)](https://www.khanacademy.org/math/multivariable-calculus/thinking-about-multivariable-function/x786f2022:vectors-and-matrices/a/vectors-and-notation-mvc)
- [*Vectors and Matrices* by Marco Taboga via StatLect](https://www.statlect.com/matrix-algebra/vectors-and-matrices)
- [Handouts for Math S21a (Multivariable Calculus) at Harvard by Oliver Knill (2011 Version)](https://people.math.harvard.edu/~knill/teaching/summer2011/handouts.html)
- [Handouts for Math S21a (Multivariable Calculus) at Harvard by Oliver Knill (2022 Version)](https://people.math.harvard.edu/~knill/teaching/summer2022/handouts.html)
- [Parallel and Perpendicular Vectors, The Unit Vector from *Mathematics for Game Developers* by Denny Burzynski](https://math.libretexts.org/Bookshelves/Applied_Mathematics/Mathematics_for_Game_Developers_(Burzynski)/02%3A_Vectors_In_Two_Dimensions/2.05%3A_Parallel_and_Perpendicular_Vectors_The_Unit_Vector)
- https://www.euclideanspace.com/maths/algebra/clifford/index.htm
## Wikipedia and Stack Exchange Quick Links
- https://en.wikipedia.org/wiki/Einstein_notation?useskin=vector#Application
- https://en.wikipedia.org/wiki/Bivector
- https://en.wikipedia.org/wiki/Hadamard_product_(matrices)
- https://physics.stackexchange.com/questions/257838/what-is-the-difference-between-a-tensor-vector-and-a-matrix
- https://stackoverflow.com/questions/243945/calculating-a-2d-vectors-cross-product
- https://math.stackexchange.com/questions/552347/notation-subscript-vs-superscript-for-coordinate-vector-fields