Vectors and Scalars (oh, my!)

Math!Put on your arithmetic caps, dear readers. Also your math mittens, geometry galoshes and cosine coats. Today we’re venturing after numeric prey that lurks down among the lines and angles.

There’s no danger, at least not to life or limb, but I can’t promise some ideas won’t take root in your brain. There’s a very real danger of learning something when you venture into dark territory such as this.  Even the strongest sometimes succumb, so hang on to your hats (and galoshes and mittens and coats and brains).

Today we’re going after vectors and scalars (and some other game)!

Actually, vectors and scalars are pretty easy. It’s applying them in different contexts where things can get complicated. Simply put, a scalar is one number, a vector is a bunch of numbers about one thing. Unfortunately, putting it that simply doesn’t tell us much.

So let’s talk about speed (which is a scalar) and velocity (which is a vector).

For most, speed and velocity likely mean the same thing: how fast something is going.

40 MPH

But 40 whats?

If someone asks our speed, we might reply, “I’m going 40 miles per hour.”

If they asked for our velocity, we might look at them funny, but would probably still give the same answer.

Technically speaking (and we are speaking technically here), 40 MPH is an incomplete answer to, “What is your velocity?” A complete answer requires specifying speed and direction. Velocity is a vector consisting of two parts: speed and direction.

Speed — because it’s a scalar — is just a single number. That number has unitsmiles per hour in this case. Those units consist of two qualities: miles and hours. The name, miles per hour, means some number of miles traveled in one hour (the single hour is assumed).

50 pounds

Oat Groats!

So even a simple scalar like speed can have a little complexity under the surface. Compare this to simpler scalar value, weight.

If something weighs 50 pounds, then “50” is just a count of how many. Here there is no sense of “pounds per something” — it’s just pounds.

We would call speed a rate, whereas weight is a magnitude. The word, “per,” is the give-away word for a rate: miles per hour, pounds per square inch, typos per page.

Note that the number of miles traveled, the number of pounds pressing, and the count of typos, are all magnitude scalars. A magnitude per some other (single) unit creates a rate.

Now consider velocity, which is defined to have both (the scalar) speed plus another component: direction. Having more than one component makes velocity a vector.[1]

Picard

“Go that way!”

It turns out that direction is a vector on its own. It requires more than one number to specify a direction. How many depends on how many dimensions your space has.

When Captain Kircardwayer, flying through three-dimensional space on his spaceship, the Voyerprise, calls for a heading (a new direction) of “90 mark 45” this specifies two numbers — 90 and 45 (the word “mark” merely separates them).

One way to describe a direction uses angles from some reference directions. One common technique uses azimuth and elevation, both of which are angles relative to our current position. Think of the azimuth as rotation, turning to our left or right. And elevation is how much we look up or down.

There are two basic approaches. The angle can be from 0 up to (but not including) 360 — a complete circle. Or it can go plus and minus, usually from 0 to ±180. There are pros and cons to both.[2]

direction-3d

This direction system defines “0 mark 0” as straight ahead, so “90 mark 45” is dead right (“90”) plus heading upwards at a 45-degree angle (the green arrow). Straight up is “0 mark 90” and straight down is “0 mark 270”. Directly backwards is “180 mark 0” — as in “doing a 180!”

As it turns out — at least in three-dimensional space — it always takes two numbers to specify a direction from a given point. It always takes one less number to point from somewhere than it takes to be somewhere. In five-dimensional space, for example, it takes four (five minus one).

The reason is that direction lacks a notion of distance. We might point at something obvious, but the pointing itself does not imply any distance. This lack of a magnitude accounts for the minus one aspect of a direction (vector) compared to a location (vector).

location-3dIn my Dimensional Coordinates post, I described how a location in three-dimensional space requires three numbers to specify. Now I can mention that those numbers comprise a location vector.

A key point of that other post was that dimensions and coordinates are related.

A coordinate is a point along some dimension. So, to specify a point in space, we always need as many coordinates as we have dimensions.

They can be X-Y-Z, or a pair of angles (such as longitude and latitude) plus a distance. We call these Cartesian or polar coordinate systems respectively. There are other ways to specify location and direction, but they all tend to require N and N-1 numbers (respectively) where N is the number of dimensions.[3]

Let’s get back to our two-number direction vector. Using angles for both numbers is common. We can also project those two angles onto an imaginary surface surrounding us and think of them as “X-Y” coordinates on that surface. (Regardless, it’s still just two numbers.)

long and lat

Where in the world…

This is exactly what’s going on with longitude and latitude. We often think of them as being like “X-Y” coordinates, but both are actually angles relative to the center of the Earth.

Notice that these use the plus-minus angle forms. Latitude is plus and minus elevation north and south. Longitude is plus and minus angle west and east.

Obviously, these systems require reference directions to call “zero” — the angles are measured relative to the references.

On the Earth, longitude is relative — +east, -west —  to the prime meridian, and latitude is relative — +north, -south — to the equator.

On a flat surface (which has only two dimensions) it takes just one number (two minus one) to specify a direction away from some point. This is because we can only move away from a point along some single angle.

direction-2d

Set a course of “135”!

If the reference direction is straight up, we can measure any direction away from a point on a flat surface as an angle relative to straight up being 0 (zero) degrees (we’ll also assume the angle goes clockwise).

If we now jump up to four dimensions, a direction requires three coordinates. If time is our fourth dimension, pointing requires a time coordinate. “My keys were over there yesterday.”[4]

And note again that pointing towards where the keys were does require three numbers (four minus one). Specifying the keys actual location requires all four coordinates. “My keys were in that place (X,Y,Z or whatever) yesterday.”[5]

An important aspect of these coordinate systems is that they assume a center point — the origin of the coordinate space. It’s the point where all the coordinate values are zero.

magnitude vectors

The dots are X-Y-Z points in 3D space. The white lines form vectors from the origin (back corner) to the two points.

This creates an interesting situation: a location vector — a point in space — has an associated magnitude vector that describes the location’s distance and direction from zero.

That vector comes from imagining a line from the zero-coordinate origin to the X-Y-Z point in space. We’re actually using six numbers, but we’re assuming half of them (3) are zero.[6]

Really, this is just a way of looking at the three location coordinates. What’s added is that it’s easy to calculate the length of the line. That gives us a single number (a magnitude scalar!) that represents the distance of the point from the origin.

More to the point, vectors frequently have a sense of “arrow-ness” to them. We’ve seen that direction vectors literally point somewhere (from a given point). Now we see that location vectors also imply a direction.

It turns out that vectors often involve pointing. Consider the difference between air temperature — a  magnitude scalar — and wind direction — a direction vector.

wind

Whither goes the wind?

At whatever resolution we want to consider, each point in the atmosphere has a temperature and a wind direction.

The temperature is just a number; it has no direction. But wind direction does have a direction and requires two numbers to describe.

Wind speed adds a third number, and wind speed plus wind direction gives us, ta da, wind velocity!

So if anyone asks you what your velocity is, you can correctly reply that you’re going 40 miles per hour on a plus-three-degree slope with a +90-degree heading (that is, going east and slightly up-hill). “40 mark +3 mark +90!” you can exclaim.[7]

Stay three-dimensional, my friends!


[1] This is different from scalars with multiple units (such as miles and hours). Vectors have multiple numbers. Scalars always have only one number; the other units are assumed: 40 miles per (one) hour; 50 pounds per (one) square inch; 32 feet per (one) second squared.

[2] The first approach suffers from a duplication of directions. For every direction with azimuth [180–360) and elevation [0–90) or (270–360) — that is, the entire left hemisphere — there is an identical direction with azimuth [0–180) and elevation (180–270).

The second approach works better, although it’s lop-sided. Azimuth is ±180 while elevation is ±90. There is also that -180 and +180 azimuth are identical. Verbally, the need to specify “plus” or “minus” is cumbersome.

gimbal

Gimbal (not locked)

Note an oddity of polar coordinates: degenerate cases where value of one (or more) coordinate(s) doesn’t matter.

When the distance of a polar system is zero (that is, in the center), both the longitude and latitude don’t matter. Likewise, at the poles (90° latitude), the longitude doesn’t matter.

(These degenerate conditions can result in gimbal lock.)

[3] There is an abstract way to reduce any multi-dimensional space to a one-dimensional coordinate system using space-filling curves, but [A] abstract and [B] beyond the scope of this already long post.

[4] Unless the time coordinate is the magnitude being left out. If we say, “My keys were there before,” we’re pointing backwards in time but not specifying a time coordinate.

[5] Dimensions can be abstract rather than physical. Time can be considered a dimension, and 4D+ “physical” spaces cannot be visualized. This is a place where math goes beyond the world as we see it.

[6] Taking it to the next level, consider a (straight) path through (3D) space. It has a start point and an end point. We could specify them as X-Y-Z locations. That means a 3D path requires six numbers. If we try having an X-Y-Z start point plus a direction (two more numbers), we still need a path length, and that brings us to six numbers.

two pointsThis makes sense. In geometry, a line is defined by two points. In 3D space, a point requires three numbers to specify (because we’re in 3D space). So a line requires six numbers.

This holds true in 2D. On a flat surface, a point takes two numbers to specify (e.g. X-Y). A line is still defined by two points, so a 2D path requires four numbers. Thinking of it as a start point (X-Y) plus a direction angle plus a length still takes four numbers.

It even works in 1D! On a line, a point only requires a single number to specify. Two points on that line specify a path on the line. (The logic also extends into four (and more) dimensions, but we’re unable to picture those in our mind!)

The bottom line: A (straight) path requires twice as many coordinates as dimensions. A line can be objectively specified by naming its end points, or subjectively by naming the start point, direction, and distance.

[7] Assuming that actually is the way you’re going.

About Wyrd Smythe

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts. View all posts by Wyrd Smythe

13 responses to “Vectors and Scalars (oh, my!)

  • Wyrd Smythe

    A long post, I know, but it’s part of the foundation for some upcoming more important posts!

  • Vectors and Scalars (oh, my!) | WatchingPhysics

    […] Source: Vectors and Scalars (oh, my!) […]

  • rung2diotimasladder

    Okay I’m seeing lots of graphs and math textbook-looking stuff here. All I can say is my velocity is “slowly going south”.

    • Wyrd Smythe

      Tch. I wish I could help you past your math antipathy! It’s a topic that actually sorely divides me. On some level, being innumerate strikes me as somewhat like being illiterate (and “hating” math strikes me like hating language). But I have my own severe difficulties with (and some degree of antipathy towards) learning other spoken languages as a very personal data point, and I’ve heard people (you’re one of them) describe how hard they tried to “get” math.

      So I’m inclined to accept that brain wiring does have something to do with it. And perhaps, like language, it’s something that needs to be instilled early and the right way to really take. But it seems tragic to me that such a huge part — such a useful and beautiful part — of reality would be “Here There Be Dragons” to so many. I see that as heart-breaking!

      (OTOH, it’s fascinating to me that your fiction’s main character is a mathematician. What an intriguing and interesting choice to a make given your own feelings about math!)

      • rung2diotimasladder

        I know how you feel, I really do. To be honest, I didn’t really try with your last post. I’m having a hard time just getting normal things done these days. I’m focusing on writing during my good three hours in the morning, then after that my brain just kind of pushes on, eager to get to the next episode of Dexter. Which is also why my blogging has come to a near standstill.

        But you’re right, I did really try with math. I did fine in all my math classes as far as grades go, but that was sheer tenacity. It hurt. And I don’t remember a thing. Well, I’ll take that back…I remembered who Roger Penrose was. I was shocked when my husband said he was attending “some lecture by some mathematician named Roger Penrose.” I couldn’t believe he didn’t know who Penrose was. My husband knows EVERYTHING. And PENROSE of all people! (As you can see, I still can’t believe it. I’m actually shaking my head.) You should have seen me jumping up and down, pointing, shouting, “Nanny nanny boo boo, I know something you don’t!” Then I went on to explain to my husband why he of all people should know who Roger Penrose is. That felt so good. 🙂

        (Incidentally, I was going through the worst part of the dizzy crap at that time, so I didn’t get to go to the lecture.)

        On language, yeah, my husband is like you in that way. Although he did really well with reading comprehension, just not speaking or listening comprehension. He had to take French, German, Latin and Greek, of course. I think for him it’s a lack of musicality. I’m very musical, so mimicking sound comes naturally to me. Plus, they say learning language is something that should be done through speaking, naturally, the way we do when we’re children. If you try to memorize rules, you can only get so far. For instance, in my ancient Greek class, we learned a lot by speaking…a totally different approach to the way it used to be taught. It’s supposed to stick better that way. (Of course, you still need to learn your grammar too.)

        How are you on music? Just curious.

      • Wyrd Smythe

        “To be honest, I didn’t really try with your last post.”

        That’s okay. (I’m sad to hear that you’re still struggling with the mystery ailment!) Really, the important part, to the extent any of it is important at all, is the gist. Math exists pretty much everywhere in life, so if it’s a completely alien land, a lot of reality is closed to you.

        “I remembered who Roger Penrose was.”

        What did you remember about Penrose, his tiles, maybe? The whole idea of non-periodic tiling is not just fascinating (and a model of certain kinds of crystals) but beautiful! That’s part of the great thing about math — some of it is really, really beautiful. Fractals, for example, can be just stunning.

        “Then I went on to explain to my husband why he of all people should know who Roger Penrose is.”

        Your husband is a philosopher, isn’t he? So is Penrose, I guess, but he’s more well-known among physicists and mathematicians, I’d think. Is your husband into physics and maths?

        “I didn’t get to go to the lecture.”

        There are Penrose lectures on YouTube! Also lectures by many other well-known modern names in physics and mathematics. (It’s kind of cool, actually, to actually listen to some of these guys I’ve heard so much about.)

        “Plus, they say learning language is something that should be done through speaking, naturally, the way we do when we’re children.”

        That’s the whole theory behind “language camps” (and some language teachers who only permit the language being taught spoken in class). The ultimate, supposedly, is actually living in a foreign country. It’s all a “sink or swim” theory figuring that sinking will only embarrass you, not kill you.

        “How are you on music?”

        I love it!

        There may be something to your theory. I love music and have played since I was, like, three, but I’ve also suffered from a severe hearing loss all my life. I think I have a musical sense, but not a musical ear (let alone anything like perfect pitch).

        Not hearing foreign words correctly probably does impact one’s ability to learn them.

      • rung2diotimasladder

        Yeah, it was the tiles. But also that he’s a mathematical Platonist. (Which is why I was surprised my husband didn’t know him.)

        I just found this quote:

        “Platonic existence, as I see it, refers to the existence of an objective external standard that is not dependent upon our individual opinions nor upon our particular culture. Such ‘existence’ could also refer to things other than mathematics, such as to morality or aesthetics, but I am here concerned just with mathematical objectivity, which seems to be a much clearer issue…

        Plato himself would have insisted that there are two other fundamental absolute ideals, namely that of the Beautiful and that of the Good. I am not at all adverse to admitting the existence of such ideals, and to allowing the Platonic world to be extended so as to contain absolutes of this nature.”

        On language, I think you’ve got to have both the fundamental grammar and vocab (in a second language) and the immersion. If you were to drop me in China, I don’t think I’d just start learning Chinese. I’d have to learn the fundamentals first, then build from that. I didn’t get much of the fundamentals when I was dropped in France, but I guess it was just enough to get by. It actually took me about three months to be able to hear individual words rather than a string of noise. That could be a peculiarity of the French, though. I hear Spanish words just fine. I can sometimes even figure out what’s being said.

        The problem comes with people who are very rule-oriented. They memorize those rules and even the exceptions to the rules, they memorize vocab, then they think they can take these parts and add them together and that’s it. My husband does this all the time and I can totally see the logic behind it, but I have to explain to him that the French don’t actually say it that way. Which is why it’s actually a lot better to learn phrases in particular contexts. Language doesn’t always make sense. If you take it too literally, you’ll drive yourself nuts.

        When do you say, “vachement”? (Literally: cow-ly. “Vache” means cow. You might have heard of the cheese: La vache qui rit, otherwise known as Laughing Cow?) Well, I heard “vache” all the time. After hearing it in many many contexts, I figured it meant something less harsh than “sucks”. It also means a lot more, and I still don’t really know what. I figured “vachement” was a stand in for “really”, as in “That’s really crazy.”

        (BTW, “That sucks” in French would be, “Ca craint”…which literally means, “That fears.” Yeeeeeeaaah.)

        Well, I learned you don’t say “vachement” to an older lady selling you tomatoes in Quebec. Don’t ask me why, but she gave me this look like I’d just told her to go fuck herself. Yet in France, I heard it all the time and said it all the time with my host mom. In retrospect, I think she was just the kind of person who used vulgar language. I picked up a lot of informal French that I didn’t know was informal, and my host’s son was a bit of a thug, so who knows what I sound like now.

      • Wyrd Smythe

        I like that Penrose quote! I quite agree.

        I read somewhere once a mathematician saying that most working mathematicians are Platonists on some level. He thought it might be they sub-consciously don’t want to spend their lives working on something that isn’t real. Yet most of the people who claim to be mathematicians on the intertubes thingy seem to deny any form of Platonism.

        So… [A] What I read was just plain wrong (pity, it sounded right); [2] It was true, but modern mathematicians don’t think that way; [iii] Those people on the intertubes were either not really mathematicians or didn’t really represent the community or didn’t really know what they were talking about.

        Experience suggests you can hardly go wrong betting on [iii], but who knows. I know there are very weird things in math that seem really made up (but time and again those thing turn out to model some real world thing). But math seems so fundamental, it’s hard to see how it can be made up.

        You clearly have a much stronger grasp of language than I! I’ve taken Spanish for a year and listened to it a lot (sometimes I watch Spanish language channels just because I love the sound of the language (and the Latinas) plus I wonder if I listen long enough some of it might seep in). I took German for four years, even traveled to Germany, but it never really took, and it’s long gone now.

        On the other hand, I’m fluent in over a dozen computer languages, so I don’t feel too bad.

        “Language doesn’t always make sense.”

        No, it’s a socially evolved thing created over time and, in most cases, constantly evolving. Sort of the ultimate crowd-sourced job.

        “I think she was just the kind of person who used vulgar language.”

        I’ve heard of that happening… people learning fluency from someone who used the language crudely or in some unique way. Still, it’s got to be a pretty good base from which to improve!

      • rung2diotimasladder

        I don’t know what the inter tubes thing is. (I’m sure I just revealed myself to be a total ignoramus, and now everyone can laugh and point at me, which is what I deserve after doing that to my husband.) 🙂

        I have no idea what most mathematicians think. I only know one in person, and he died just this year. I never got to ask him what he thought of the reality of mathematics.

        I just realized that I didn’t answer your question about the character in my novel. So…the main character represents Socrates and he’s a philosophy professor. The next most important character is a mathematician—a math student, rather (Glaucon in the Republic, although I’ve sort of melded him with Plato since Glaucon was Plato’s brother.)

        You took German? That’s a tough one. Nominative, accusative, genitive, dative? Like Greek? Not to mention the ridiculously long words. I went to Berlin for a little while and I remember staring at a billboard for a long time just trying to sound out some word that went on for years.

        I’m actually not that great at language…I’m just better at it than math. I’m good at mimicking sound, which might count for a lot when you’re trying to get by. I took a phonetics course while in France and after that I got the best compliment: While at a party with the American students in my program, a French woman looked at me with surprise when I said something about being an American. She thought I was French! (I think that only happened because I didn’t say much and she had other Americans all around who sounded really really American. If I had had to give a long speech, she would have noticed my grammatical errors.)

      • Wyrd Smythe

        “I don’t know what the inter tubes thing is.”

        Bwa-ha-ha-ha! You’re such an ignoramus! How do you get dressed in the morning? XD

        Now that that’s out of our system, it was just me making what is probably an aging reference by now (but then I’m an aging reference, so it’s okay). There was some Senator (?) who described the internet as “like a set of tubes.” He was widely mocked for it (’cause he wasn’t on the side of the cool people) and it became kind of a meme.

        The thing is, given some important support facts (such as that the tubes are virtual and transient), it’s actually an excellent metaphor. The internet is like a set of tubes. Exactly like.

        So I wyrd play variously with internet (the original name and still the name for the whole ball of wax), the interweb (which is just the browsers part), and the intertubes thingy. Mostly to amuse myself, but also to mark that you can’t take those tubes too seriously or they’ll take over your mind.

        Sort of like a combined shopping-videogame-gambling-sex addiction with texting thrown in.

        “The next most important character is a mathematician—a math student…”

        Ah, not the main character. Got it. How’s the novel coming along?

        “You took German?”

        Yeah, four years in high school. Didn’t take. At all. The intent was to be able to read scientific documents in the original German. We had to take a language class, so it was a matter of picking between Spanish, German, French, or Latin. I was basically “none of the above” so it was a “least worst” pick.

        In retrospect, Spanish would have been a useful choice (assuming I’d actually learned it).

        “She thought I was French!”

        Well, you do look like you’re from France. 😀

      • rung2diotimasladder

        Thanks for the lesson! Now I’ve never thought of the internet as a set of tubes, but I have no idea what to think of the internet. I’d probably liken it to a ghost that runs around whispering things into machines.

        The novel is starting to pick up again. Unfortunately it keeps getting longer and longer when it needs to get shorter. Oh well. I’m sure there’s a lot I can cut later.

        German would be the hardest of all those, excepting Latin maybe. Spanish is the language of choice for those who don’t want to work too hard. And yes, it is useful. Very useful in Tucson especially.

        I chose French because I really had no other options. There was a good French teacher with an actual class. Or I could take whatever language I wanted to, but I’d be doing it on my own. I decided to go for French. (I ended up squeezing Descartes into my thesis to make sense of all the French classes I took. It worked out pretty well.)

        ““She thought I was French!”
        Well, you do look like you’re from France. :D”

        Yeah, I look American too. 😉

        Actually, I probably do. Americans are easy to spot abroad. To the French we look like we’re going out for a jog or going to bed. Maybe it was my Asian side that threw her off.

      • Wyrd Smythe

        “Now I’ve never thought of the internet as a set of tubes, but I have no idea what to think of the internet.”

        It occurs to me that “the internet” actually means two rather different things. It can refer to the network itself, in which case the “tubes” metaphor is quite apt. But it can also refer to all the things connected to that network — the content that is the substance of “the internet” — the point of having the network! (In which case the “tubes” metaphor is kinda “huh?”)

        As far as the network is concerned, when you view a webpage, it’s via a connection through that network from your computer to the computer hosting the website. That connection can be thought of as a tube through which data passes back and forth between you and the other computer.

        “Unfortunately [the novel] keeps getting longer and longer when it needs to get shorter.”

        When that happens to SF writers, they go, “Oh, now it’s a trilogy!” XD

        “I look American too.”

        No, you look like you’re from France. 🐱

        (I’m making another obscure cultural reference. Remember how the Coneheads were “from France”? I think the guys on 3rd Rock From the Sun also sometimes said they were from France. Loved that show!)

      • rung2diotimasladder

        Hm, I think I’ll stick with the ghost metaphor. Tubes are boring.

        Ah, yes I do know the Coneheads…I hadn’t put those things together. I had totally forgotten that one!

%d bloggers like this: