SAGE : Vector Operations

Vectors can be created using either vector((a,b,c)) or vector([a,b,c])

1. Find the norm of $\textbf{v}=\langle 2,6,4\rangle$


2. Find the dot product and cross product of $\textbf{u}=\langle 4,-2,5\rangle$ and $\textbf{v}=\langle 2,3,-1\rangle$


3. Find the scalar projection of $\textbf{u}=\langle 4, 6\rangle$ onto $\textbf{v}= \langle 12, 3 \rangle$

The scalar projection is given by $$\text{comp}_\textbf{v}(\textbf{u})=\frac{\textbf{u}\bullet \textbf{v}}{\|\textbf{u}\|\|\textbf{v}\|}$$


4. Find the vector projection of $\textbf{u}=\langle 3, 4\rangle$ onto $\textbf{v}= \langle 8, 6 \rangle$

The vector projection is given by $$\text{proj}_\textbf{v}(\textbf{u})=\frac{\textbf{u}\bullet \textbf{v}}{\|\textbf{u}\|\|\textbf{v}\|}\textbf{v}$$