# Linear Algebra Refresher /w Python

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

Vectors written as $$\begin{bmatrix} x \ y \ z \end{bmatrix}$$

Magnitude and Direction:

$$3-D$$imensions

$$| \vec{v}| = \sqrt{v\_x^2 + v\_y^2+v\_z^2}$$

$$n-D$$imensions

$$|\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

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

Example:&#x20;

$$\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}$$

$$\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}$$


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stephanosterburg.gitbook.io/scrapbook/math/udacity/linear-algebra-refresher-w-python.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
