Wednesday, July 23, 2014

Basic Physics: Part 0, Section 3: Vector Multiplication

Welcome back to my Basic Physics series! In previous sections, I covered some basic algebra topics, necessary trig functionscoordinate systems and vectors. The last post was getting rather long, and since vector multiplication is a bit tricky, I broke that topic into its own section, which you have before you! And I going to further preface this section with this: if you read through this, and you aren't sure you understand what is going on, don't give up! It's not easy to understand, and it looks down right weird; I think my reaction upon first introduction was something along the lines of 'what new devilry is this?!". I'm pretty sure I was using vector multiplication for at least 4 years before really understanding what it is. It didn't stop me from getting a B.Sci in physics, and it shouldn't discourage you from continuing reading this series, because it is possible to use these things without really understanding. Think of it like a car--you use a car everyday, you can make it do what you want, but almost everything under the hood is a mystery. Doesn't mean you can't use it to get you where you want to go! They also get easier with physical examples, which we will get to in coming posts. 

There are two types of vector multiplication. Each has its own uses and peculiarities. This section is going to cover what they are, their peculiarities, and how to do them. They pop up repeatedly in physics, so we'll discover their myriad uses along the way. Let's bring back our two arbitrary vectors from the last post 
$$\vec{v} = a \hat{x} + b \hat{y} + c \hat{z}$$
$$\vec{w} = d \hat{x} + e \hat{y} + f \hat{z}$$
and see what weird things we can do with them!

The first type of multiplication is called the "dot product" (remember that "product" is whatever results from a multiplication), and we get the new symbol \(\cdot \) to indicate that we are combining two vectors using this method. It is fairly straight forward: you multiply the x-hat components together, you multiply all the y-hat components together, you multiply all the z-hat components together and then you add up the results. 
$$\vec{v} \cdot \vec{w} = (a \hat{x} + b \hat{y} + c \hat{z})\cdot(d \hat{x} + e \hat{y} + f \hat{z})$$
$$\hspace{15 pt} = (a*d) + (b*e) + (c*f) = ad+be+cf$$
Interestingly, a dot product of two vectors does not yield a new vector with magnitude and direction, but rather a "scalar" which just has magnitude. This little quirk becomes very important when we get to electromagnetism. It should also be noted that the dot product is commutative, which is to say that 
$$ \vec{v} \cdot \vec{w} = \vec{w} \cdot \vec{v} $$
The same cannot be said of the other type of vector multiplication, which we will get to shortly. 

So, what does a dot product tell you? Speaking geometrically, it gives you the product of the length of the projection of one vector onto another vector. That's about as clear as mud, so lets look at some pictures. Here we have two vectors, \(\vec{A}\) (red), and \( \vec{B}\) (green), with an angle \( \theta \)  between them. 


If we draw a line between the end of \(\vec{A}\) and the point on \( \vec{B}\) where that line can intersect normally

we now have a right triangle. And we know from two weeks ago in the trigonometric section what to do with right triangles. We are given the angle, so by using the cosine function we can find the length of the projection of \(\vec{A}\) onto \(\vec{B}\), kind of like finding the length of your shadow. Let's label that projection \(A_B\) since it's the shadow of \(\vec{A}\) on \( \vec{B}\). So
$$ A_B = |\vec{A}| \cos{(\theta)} $$
with the vertical lines around indicating that we are using the total length, the magnitude, of A and not the vector form. The direction information is not helpful when dealing with triangles. So now we have the length of the projection of \(\vec{A}\) onto \(\vec{B}\). Assuming we have the length of \(\vec{B}\)  we can now find the geometric value of the dot product
$$ \vec{A} \cdot \vec{B} = |\vec{A}| \cos{(\theta)} |\vec{B}|$$
or, more prettily and more commonly,
$$ \vec{A} \cdot \vec{B} = |\vec{A}|  |\vec{B}|\cos{(\theta)}$$
This is another way to calculate the dot product, and is handy if you have been given magnitudes and angles, and not the component form for your vectors. 

But what does this mean, I can imagine you asking. Recall the idea of orthogonality from the previous section. The dot product allows you to relate two vectors based on the degree to which they are orthogonal to each other. If two vectors are perfectly orthogonal, the angle between them is \(90^{\circ}\), there is no projection, no 'shadow' of one vector onto the other, the cosine is zero, and the dot product is zero. The vectors are completely unrelated to one another, and they have no multiplicative interaction. If, on the other hand, the angle between them is \( 0^{\circ}\), then the cosine between them is 1 and they are parallel. They are both going in the same direction and can have the largest multiplicative effect on one another. (If you happen to dot a vector with itself, the angle will be zero, the magnitudes will be identical and you will get the square of the magnitudes. This is in fact how the magnitude of a vector is defined--the square root of the vector dotted with itself.) For any angle in between the effect is proportionately diminished. This will be easier to see when we can give some physical examples. 

The second type of vector multiplication is the "cross product", and the \( \times \) symbol which you probably learned to use for regular old multiplication back in elementary school gets reserved for this particular operation from here on in. Regular multiplication is usually indicated either by abutting parentheses, by an asterisk, or in the case of variable/coefficient terms just writing them next to each other without a space, as in the dot product example above. However, it is not generally as straightforward a calculation as the dot product, because the result of a cross product is still a vector. 

In order to calculate the cross product from scratch, as it were, we need to borrow a tool from linear algebra, namely the determinant*. The determinant is a way to arrange vectors so that you can easily calculate the cross product, no matter the size of your vectors. It is basically an organizational tool.  Once again, let's use the general vectors \(\vec{v}\), \(\vec{w}\), and calculate the cross product of \( \vec{v} \times \vec{w}\). 
$$ \vec{v} \times \vec{w} =\begin{vmatrix}\hat{x}& \hat{y} & \hat{z} \\ a & b & c \\ d & e & f  \end{vmatrix}$$
First, let's dissect what this thing is, line by line. 

 The first row is a label row of sorts. They label each column and they will help label the results. All the \(\hat{x}\) components go in the column under the \(\hat{x}\); if there is no \(\hat{x}\) component to a particular vector, that column gets a 0 for an entry for that vector's row. The same goes for the rest of the directions, namely \( \hat{y}\) and \(\hat{z}\).


 The second row is where the elements from the first vector, in this case \(\vec{v}\) are placed in their respective columns. Remember, if a vector is lacking an element, it is entered as a zero; the column is not deleted entirely, even if all it contains is the label and zeros.

The third row is treated in the same manner as the second row, except that it contains the second vector, in this case \(\vec{w}\). It's rather like filling out a spreadsheet. 

Now what do we do with this thing? 

You first calculate the \(\hat{x}\) component. To do this, you imagine blocking out everything that shares the \(\hat{x}\) column and row, leaving you with a square of components that are not the \(\hat{x}\) component

With those remaining 4 elements, you multiply the diagonal elements, and subtract the lower left/upper right pairing from the upper left/lower right pairing. So the results of this step are 
$$\hat{x} (bf-ec) $$
Note that the \(\hat{x}\) component of the product contains every element except the \(\hat{x}\) components of the  original vectors. Cool, right?

The second step is a little strange, because by blocking out everything in the \(\hat{y}\) element's column and row, we get a kind of split square, or two rectangles. 

What this means is that you have to subtract this result from the final product. You multiply the elements from the two rectangles as though it were one square, so this component of the product gives us
$$-\hat{y}(af - cd)$$
So far, so good. 

The last component is almost identical to the first. 

And you find the results the same way you did for the \(\hat{x}\) portion of the product. So the final bit is 
$$\hat{z}(ae-db)$$
Weird, but not too horribly complicated.  So the final result is 
$$\vec{v} \times \vec{w} = \hat{x} (bf-ec) -\hat{y}(af - cd) + \hat{z}(ae-db) $$

Some people are able to simply memorize the result given above, and don't bother to use the determinant. I am not one of those people gifted in memorizing formulae.  It's easier for me to remember a compact method or tool than to memorize lines of elements. 

It should be noted that the cross product is not commutative--the order in which things are multiplied matters, unlike the dot product. That is to say, \( \vec{v} \times \vec{w} \neq \vec{w} times \vec{v}\). It is however anticommutative, which means that reversing the order negates the result: \( \vec{v} \times \vec{w} = - \vec{w} \times \vec{v}\). 

So, what does the cross product give you? This is a little easier put than the dot product. The cross product calculates the area of the parallelogram whose sides are defined by the two vectors. 
So what's all that vector information doing? Well, hold on to your socks, it turns out that area is a vector quantity. Yep, and the direction of that area is normal to the surface which the area is a measure of. So if you can imagine standing on that parallelogram, which every direction is straight out of your head is the direction that that area points! This also make clearer an important point about the cross-product, which is that the resulting vector from a cross product is necessarily orthogonal to its two parent vectors. The two vectors must lie in a plane to form a parallelogram, and the normal to that parallelogram must be normal to the two vectors defining that parallelogram. 

The fact that the cross product calculates the area of a parallelogram leads us to our last point. What if you don't need to know which way the area is pointing, for some reason? You just need the magnitude of the result, not the whole thing. Well, if you remember your geometry you might recall that the area of a parallelogram can be found by multiplying the lengths of the sides and the sine of the angle between the sides. The same formula works for the cross product in a way. Assuming you have the magnitudes of each vector and the angle between them, you can find the magnitude of the cross product, at the cost of the direction information. 
$$|\vec{v} \times \vec{w} | = |\vec{v}| |\vec{w}| \sin{(\theta)}$$

That wraps up what you need to know from vectors. I know it may seem like a lot, but remember that it's a tool in our tool kit for physics. We will be using these tools frequently, and like any skill it becomes easier with use, and you get to build more incredible things the better you become!

As always, I hope that I have explained things clearly. If I haven't, please let me know in the comments, and I'll do my best to clarify!

*DH objected to this section, because what physicists call a determinant is technically a 'formal determinant', as it has the right form but does not adhere to the strict definition used by mathematicians. If you should show this to a mathematician, they will twitch, and possibly rant about physicists. This is the normal reaction of mathematicians to physicist notation. 

However, the math editor of this blog, sirluke777, objects to DH's objection, and says it's perfectly fine. His background is math, physics and chemistry, so make of that what you will. If there is an outcome to this math geek debate, I will update here. 

No comments: