August 5, 2023

Vectors

Vectors have lots of applications, from raytracing to predicting the paths of objects in physics. They can be considered the link between numbers and pictures, and can be a powerful visualisaion tool for a wide range of topics. Let this be your visual guide to the properties of vectors and the ideas around them.

Lines

Vector lines are defined parametrically in terms of another variable, usually \(t\). Vector lines work exactly the same as normal linear equations.

Start with any vector \(\color{#5492f0}{\vec{c}}\). This point defines the position of the line (where it starts). The is now a vector \(\color{#F09B24}{\vec{v}}\), and indicates the direction of the line. You can represent this as the equation \( line(t) = \color{#F09B24}{\vec{v}t} + \color{#5492f0}{\vec{c}} \), shown below. As you vary the parameter \( t \), notice that the tip of the vector traces out a line.

Because the slope \(\color{#F09B24}{\vec{v}}\) is scaled up and down to trace the line, it doesn't matter what the length of the original vector is, as it still traces the same line, but just with a different speed.

Colinear Vectors

Colinear refers to Vectors that lie on the same line. The line they all lie on does not necessarily pass through the origin. Below is an example of vectors that are all colinear.

You can show this algebraically by comparing the slope of the line between any two vectors. If the direction of the two slopes are the same, you have shown the vectors to be colinear.

Linear Dependance

linear dependance extends the idea of colinearity. a set of vectors are linearly independant if there are no "redundant" vectors in the set that don't help you reach new points. So theese vectors below linearly independant, since they all point in new directions, and allow acess to new points. Drag around the white point and convince yourself that you can indeed reach every point with just these two vectors.

if you were to add another 2d vector to this group, you could always make it using the other two, so the vectors would not be all linearly independant anymore. If you added a 3d vector, it would extend the reach of the vectors, and they would still be independant, as you could now acess more points in the \(z\) axis that you couldn't using only the two shown above.

Notation

Before we continue, it will be helpful to know some notation. Vectors are usually written with an arrow or some other marking on them (for example \(\vec{a}\)) to indicate that they are a vector and not a normal number. this is not nescecary, but helps keep things clear.

Vectors can be represented algebraically in terms of the unit vectors, \( \hat{i} \), \( \hat{j} \) and \( \hat{k} \). These are special vectors called "basis vectors". They define the direction of each axis, and the size of a "unit". A vector with cordinates \(x\), \(y\) andn \(z\) is written as \( x \hat{i} + y \hat{j} + z \hat{k} \).

The length of a vector \(\vec{v}\) is written as \(|\vec{v}|\) and is calculated with the pythagorean theorem. The hat symbol above each basis vector indicates that it is a unit vector, meaning it has a length of 1.

Dot Product

$$ \color{#5492f0}{\vec{a}} \cdot \color{#F09B24}{\vec{b}} = |\color{#5492f0}{\vec{a}}||\color{#F09B24}{\vec{b}}|\cos{\theta} = \color{#5492f0}{a_{x}}\color{#F09B24}{b_{x}} + \color{#5492f0}{a_{y}}\color{#F09B24}{b_{y}} $$ The dot product, denoted "\(\color{#5492f0}{\vec{a}} \cdot \color{#F09B24}{\vec{b}} \)" is a measure of alignment of vectors. it is equal to zero when the two vectors are perpendicular and negative when they are opposing. It gives a larger value the closer the two vectors are aligned. You can also rearrange this formula to calculate the angle between the vectors.

Projection

It is sometimes useful to project one vector onto another. this is a way of decomposing a vector into two perpendicular components. This is useful, for example, when calculating forces down a ramp in physics.

In this example we will be projecting the vector \(\color{#F09B24}{\vec{a}}\) onto \(\color{#5492f0}{\vec{b}}\), in order to find vector \(\color{#18A340}{\vec{c}}\), as shown below.

Thanks to trigonomerty, we know that the length of \(\color{#18A340}{\vec{c}}\) is \(|\color{#F09B24}{\vec{a}}|\cos{\theta}\). We can normalize \(\color{#5492f0}{\vec{b}}\) and use the dot product to find this value, and we find that \( |\color{#18A340}{\vec{c}}| = \color{#F09B24}{\vec{a}} \cdot \color{#5492f0}{\hat{b}} \)

We can now scale \(\color{#5492f0}{\vec{b}}\) to have the correct length, and we have found our projection.

$$ \color{#18A340}{\vec{c}} = (\color{#F09B24}{\vec{a}} \cdot \color{#5492f0}{\hat{b}})\color{#5492f0}{\hat{b}} $$

we can also find the other component of this decomposition \(\vec{d}\) (the dotted line) by subtracting from \(\color{#F09B24}{\vec{a}}\). and we find that:

$$ \vec{d} = \color{#F09B24}{\vec{a}} - \color{#18A340}{\vec{c}} $$

Differentiation & Integration

Differentiating a variable valued function is the same as differentiating each of its components. this is because you can split up each component of the vector into a sum of the bases. this means you can differentiate each term on its own using a scalar derivative. The same idea applies to integration.

$$ \vec{r}(t) = x(t) \hat{i} + y(t) \hat{j} + z(t) \hat{k} $$

$$ \color{#d43cd4}{\frac{ d\vec{r} }{ dt }} = \frac{ \color{#18A340}{d\vec{r}} }{ \color{#8a8a8a}{dt} } = \frac{ \color{#5492f0}{dx} }{ \color{#8a8a8a}{dt} }\hat{i} + \frac{ \color{#F09B24}{dy} }{ \color{#8a8a8a}{dt} }\hat{j} + \frac{ dz }{ \color{#8a8a8a}{dt} }\hat{k} $$

Arc Length and Area

Arc Length is found by approximating the curve using straight segments, and adding up the length of each segment to get the approximate length. This approximation is better for smaller values of \(dt\), and in the limit is equal to the actual length. You can see below the segments more accurately folow the line the smaller \(dt\) is.

$$ length = \int \biggl| \color{#F09B24}{ \frac{ d\vec{r} }{ dt } } \biggr| \color{#8a8a8a}{dt} = \int \sqrt{ \dot{x}(t)^2 + \dot{y}(t)^2 + \dot{z}(t)^2 } \color{#8a8a8a}{dt} $$

Areas are under a graph are found using rectangles as normal, but now the width of the rectangles is not a constant, and depends on the horizontal velocity at that point.

$$ area = \int \color{#F09B24}{y(t)} \color{#5492f0}{\frac{ dx }{ dt }} \color{#8a8a8a}{dt} $$