## Vectors

Prerequisites:

- All the previous math primers

Vectors, those pesky things they taught you at school which you hated, and had no idea what they were, remember them? Yeah, me neither. Before I start teaching though, while you only need this to understand my tutorials, if you're actually gonna be building anything decent, you'll need much more than what I will be teaching. I will therefore recommend you to pick up any good book on Vector algebra, and if you can invest the time, linear algebra, it makes solving equations in complex networks so much more easier. My recommendation would be D. Lay's book on linear algebra.

With that done, let's focus. I'm going to assume that you know how lines and linear equations work, so I won't bother explaining them.

What is a Vector? Black Magic?

No, uh, they're not. The concepts are pretty simple actually. Anything with a direction and magnitude. That's all there is to a vector. They have a few quirks though. Let me explain. First of all, let's consider a 2D plane (you won't be needing 3D vectors in EE). It's your usual Cartesian plane. You have two axes, called $x$ and $y$ by convention. $x$ being horizontal, and the other one being vertical. In this plane if I were to represent a vector, it would be a line segment of any length that's equal or is proportional to the magnitude of whatever quantity is being measured here, and its direction. So, they're like lines? Well, kinda, but not really. A lot of their properties involve lines and triangles, but they're not lines or triangles. A better description would be an arrow. That;s probably the best way to describe it - an arrow. In fact, we even represent vectors like this $\vec{A}$. A vector will start from any point on the plane, and terminate at some other point, but the vector doesn't need those points to be given. They can be arbitrary, but the vector remains the same. So a vector that points to north, has a magnitude of 1, and is same regardless of whether it starts from $(0, 0)$ and ends on $(0, 1)$, or $(10, 10)$ and $(10, 11)$. This is also where one of their most important properties come from - parallel vectors with the same magnitude are equal. It doesn't matter where they are, as long as their directions and magnitude are equal. Vectors are also said to be made up of components, it's a slightly harder concept, but in the same way that you can describe line segments, vectors can also be describe, just it's the change in each of the corresponding axes. Let's look at the above two examples -

For $(0, 0)$ and $(0, 1)$

$$\Delta x = x_2 - x_1 = 0 - 0 = 0$$

$$\Delta y= y_2 - y_1 = 1 - 0 = 1 $$

Btw, $\Delta$ is just a symbol denoting change in something.

We have the components of this vector, and now we need to represent them. There are two ways -

$\vec A = 0\cdot \hat x + 1\cdot \hat y$

or simply,

$\vec A = <0, 1>$

If you try this for the other example, you should get the same result. Try it out.

Also,

$|\vec A| = A = \sqrt{x^2 + y^2}$

Try deriving this on yourself. It only need Pythagoras' theorem.

Operations on Vectors:

As I said before, this is not exhaustive, in fact, it's a very basic primer. So, not everything will be here.

Addition

Vectors can be added quite simply. You just take their components and add them -

$$\vec A = <x_1, y_1> \space \space \space \vec B = <x_2, y_2>$$

$$\vec A + \vec B = <x_1 + x_2, y_1 + y_2>$$

As for the magnitude -

$$|\vec A + \vec B| = \sqrt{A^2 + B^2 + 2\cdot AB \cdot cos(\theta)}$$

where $\theta$ is the angle between both vectors. This is harder to derive. and uses a trigonometric concept called "the law of cosines". Not really something needed for EE, so I won't be teaching any of that. You can and should look it up if you're interested, or PM me if you want a separate lesson to be posted on that. Subtraction is defined the same way, just substitute $\vec B$ for $-\vec B$.

Scalar Multiplication

This is probably the easiest property of all things. When there's a scalar (a number belonging to $\Bbb {R, Z} etc$) you simply multiply the magnitude, or each of the components by that number, and that's it. That's also why $\vec B$ = $-\vec B$ works.

And that's it. This is all you need. Good day good sirs (no I won't say madam, because its stupid, and I'm lazy. I'm not changing habits because some guy on the internet tells me to do it).

With that done, let's focus. I'm going to assume that you know how lines and linear equations work, so I won't bother explaining them.

What is a Vector? Black Magic?

No, uh, they're not. The concepts are pretty simple actually. Anything with a direction and magnitude. That's all there is to a vector. They have a few quirks though. Let me explain. First of all, let's consider a 2D plane (you won't be needing 3D vectors in EE). It's your usual Cartesian plane. You have two axes, called $x$ and $y$ by convention. $x$ being horizontal, and the other one being vertical. In this plane if I were to represent a vector, it would be a line segment of any length that's equal or is proportional to the magnitude of whatever quantity is being measured here, and its direction. So, they're like lines? Well, kinda, but not really. A lot of their properties involve lines and triangles, but they're not lines or triangles. A better description would be an arrow. That;s probably the best way to describe it - an arrow. In fact, we even represent vectors like this $\vec{A}$. A vector will start from any point on the plane, and terminate at some other point, but the vector doesn't need those points to be given. They can be arbitrary, but the vector remains the same. So a vector that points to north, has a magnitude of 1, and is same regardless of whether it starts from $(0, 0)$ and ends on $(0, 1)$, or $(10, 10)$ and $(10, 11)$. This is also where one of their most important properties come from - parallel vectors with the same magnitude are equal. It doesn't matter where they are, as long as their directions and magnitude are equal. Vectors are also said to be made up of components, it's a slightly harder concept, but in the same way that you can describe line segments, vectors can also be describe, just it's the change in each of the corresponding axes. Let's look at the above two examples -

For $(0, 0)$ and $(0, 1)$

$$\Delta x = x_2 - x_1 = 0 - 0 = 0$$

$$\Delta y= y_2 - y_1 = 1 - 0 = 1 $$

Btw, $\Delta$ is just a symbol denoting change in something.

We have the components of this vector, and now we need to represent them. There are two ways -

$\vec A = 0\cdot \hat x + 1\cdot \hat y$

or simply,

$\vec A = <0, 1>$

If you try this for the other example, you should get the same result. Try it out.

Also,

$|\vec A| = A = \sqrt{x^2 + y^2}$

Try deriving this on yourself. It only need Pythagoras' theorem.

Operations on Vectors:

As I said before, this is not exhaustive, in fact, it's a very basic primer. So, not everything will be here.

Addition

Vectors can be added quite simply. You just take their components and add them -

$$\vec A = <x_1, y_1> \space \space \space \vec B = <x_2, y_2>$$

$$\vec A + \vec B = <x_1 + x_2, y_1 + y_2>$$

As for the magnitude -

$$|\vec A + \vec B| = \sqrt{A^2 + B^2 + 2\cdot AB \cdot cos(\theta)}$$

where $\theta$ is the angle between both vectors. This is harder to derive. and uses a trigonometric concept called "the law of cosines". Not really something needed for EE, so I won't be teaching any of that. You can and should look it up if you're interested, or PM me if you want a separate lesson to be posted on that. Subtraction is defined the same way, just substitute $\vec B$ for $-\vec B$.

Scalar Multiplication

This is probably the easiest property of all things. When there's a scalar (a number belonging to $\Bbb {R, Z} etc$) you simply multiply the magnitude, or each of the components by that number, and that's it. That's also why $\vec B$ = $-\vec B$ works.

And that's it. This is all you need. Good day good sirs (no I won't say madam, because its stupid, and I'm lazy. I'm not changing habits because some guy on the internet tells me to do it).