Linear Algebra Refresher /w Python

Points written as (x,y,z)(x, y ,z)

Vectors written as [xyz]\begin{bmatrix} x \\ y \\ z \end{bmatrix}

Magnitude and Direction:

3D3-Dimensions

v=vx2+vy2+vz2\| \vec{v}\| = \sqrt{v_x^2 + v_y^2+v_z^2}

nDn-Dimensions

v=v12+v22+v32+....+vn2\|\vec{v}\| = \sqrt{v_1^2 + v_2^2+v_3^2+....+v_n^2}

Normalization: process of finding a unit vector in the same direction as a given vector

1vv=unit vector in direction of v\frac{1}{\|\vec{v}\|}\vec{v}=\text{unit vector in direction of } \vec{v}

Example:

v=[111]v=(1)2+(1)2+(1)2=3u=1vv=13[111]=[1/31/31/3]\begin{aligned}\vec{v}&=\begin{bmatrix}-1\\1\\1 \end{bmatrix} \\\\ \|\vec{v}\| &= \sqrt{(-1)^2+(1)^2+(1)^2} \\\\&= \sqrt{3} \\\\ \vec{u}&=\frac{1}{\|\vec{v}\|}\vec{v} \\\\&=\frac{1}{\sqrt{3}}\begin{bmatrix}-1\\1\\1\end{bmatrix} \\\\&=\begin{bmatrix}-1/\sqrt{3}\\1/\sqrt{3}\\1/\sqrt{3} \end{bmatrix} \end{aligned}

u=(13)2+(13)2+(13)2=13+13+13=1\begin{aligned}|\vec{u}| &= \sqrt{(\frac{-1}{\sqrt{3}})^2 + (\frac{1}{\sqrt{3}})^2 + (\frac{1}{\sqrt{3}})^2 } \\\\&=\sqrt{\frac{1}{3}+\frac{1}{3}+\frac{1}{3}} \\\\&= 1\end{aligned}

Last updated