Vectors

Joshua R. Davis, Carleton College, Math 134, Fall 2024

Examples of vectors in science

A vector is a quantity with both magnitude and direction. Vectors are heavily used in physics. They represent displacements, velocities, forces, etc. For example, the movement of fluids is important in many aspects of science and engineering: how wind turbines catch wind, how fish swim, how efficient pumps are, etc. At every point in a fluid, there is a velocity vector, which tells you how fast that part of the fluid is moving, and in what direction. Here is a simple example.

f = (x^2 + y^2)^(-1 / 2) / 10;
v = {-y / (x^2 + y^2), x / (x^2 + y^2)} + Grad[f, {x, y}];
VectorPlot[v, {x, -1, 1}, {y, -1, 1}, VectorPoints->20]

If you imagine little particles of water sitting in the fluid, and you trace their trajectories as they follow those velocity vectors, then maybe you can see that they’re going to spiral into the origin, like water in a sink going down the drain.

StreamPlot[v, {x, -1, 1}, {y, -1, 1}, VectorPoints->20]

Vectors don’t have to live in 2D. They can also be 3D (or 4D, or 5D, ...). Here is a 3D gravitational force field pulling everything toward the origin.

f = (x^2 + y^2 + z^2)^(-1 / 2);
v = Grad[f, {x, y, z}];
VectorPlot3D[v, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, VectorPoints->10]

Because so many fields of study use physics, vectors show up everywhere. For example, along the San Andreas fault in California, the Pacific plate and the North American grind past each other, and the rock along the fault gets smushed. So you might get velocities and trajectories like in this example. (The Pacific plate is at the top of the picture, and the North American plate is at the bottom.)

l11 = 2;
l12 = 3;
l21 = 0;
l = {{l11, l12}, {l21, -l11}};
eig = Eigensystem[l];
If[eig[[1, 1]] < eig[[1, 2]],
	u = eig[[2, 1]],
	u = eig[[2, 2]]];
u = l.{u[[1]] / u[[2]], 1};
v = If[y > 1, u,
	If[y < -1, -u,
		l.{x, y}]];
VectorPlot[v, {x, -1.5, 1.5}, {y, -1.5, 1.5}, VectorPoints->20]
StreamPlot[v, {x, -1.5, 1.5}, {y, -1.5, 1.5}, VectorPoints->20]

Here’s an example using wind velocity data. It might take a few seconds to load. If you need to cancel this operation, then press Command-. on a macOS computer (that’s pressing the period key while holding down the Command key) or Alt-. on a Windows computer (that’s pressing the period key while holding down the Alt key).

data=GeoVectorENU[GeoPosition[CompressedData["
1:eJwVV3k01O0X/1YqpTSJGlIhpIixj/3axz4rstTYp82WihYNSSpKUqmo0YoK
SUWbK5RXQpEmSyZ5I1GTehHKb35/POf54zn3Oefe89muanAUM2wmQRCTkvP/
W2WWLfVGBx1Is9wOTeZsAt7b1FWDVh5YrvPnqM9MLhDPLuaRrxggMb56k8vM
9qpbxLLIRQZMqC/rq3c02QD77HfYsBPske+3w4/BXoPcsaKNU+FU8N5zZKLM
LBSl959QSuHZwoIjzv/sgCCgjFtWqia4AFFHpG3v2wDqEYpGzwhX1O2v3Rgd
HYalGyxCl30ElF709WfwijCYk2524eYgHQmqj/qK33KgNrYjSfUKG4mVvZWu
PmQkdJoVzFQHbaJny9buPc4A/h7WQ4cyBkLuRS6V4Q30Z8tXRYy6Yr3iC53Z
Szgw8qRRrqlIUn9w+cF4NxnkL/+irPXLGLlRzeJD541RvaJ1LGOYDbf019+c
TONCtMGnWf7DXkDZlOJ2wj4MtOLGjpvxJP/G8r4pv+DiVVMl7fRDLFDxmsmK
u+MEFae62Do2jkCOOJXZlk9Hndl1VWcXA87nRfTOrw1GraYc11UapmjtG1YW
OCsIiQL89lRbAwhi9WT85zkov/uuoKqTCQNJ1e9s/cNQxcp8nnGzG6Ts9S6x
sGVji7fxZUVpL6AvDyfnXQqD7GmzkTqKLZZvabtJ6IWCeMA2T10IwB9ieowq
eIPDVl5d8W0mCFFdM4nNxW0XX8XeYTtj6dqmkxs7nCHbVJji8YcN/MD2nwOF
ijj1JXHzMIsDfi97ppZuCkOx1K3wkadWsCUz4bn0eCjy9+xNufDKDsgquvJT
zaGARdQ7IqYxEN9Mano3OqJIxsFokAYQEOV5PtYoDAS2L5T+vlSDIsGssnsd
XOSuu/vhgb4jEpfHHsotHK+KM5KOkFZzQ2rk2t9vtwYCT/u524MzDOC2JK2f
fhMGMDagfb/JDUCq/W9aMwcKfjy5t0DODaOnec+9xa5Anm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ZWtWhWfp
ofC67JYdo4FAEj3tV9xPAaPvCitfxvsivyb1zRfSfKB8uVucHuwLXHG8iQXd
CgZeVbkl3pDw78IGq9mV5jDUd6VrIMAPxUXZelup1mCy8UBCRXswCmKzVb9t
tgGVnYJbEV3myHfTjRmZp4mgenRZoR8NCPtKYVavPkaPr09ddUGi57O+P9k0
bg282+RsVbY9dr2I8Vvcbo/Kpzvdbn0PBRVNhvvvOG1sOZ8XoPOXib429Vld
+TQs+HfCRUOS30pXfbykSTbB0JaGk5E2QVjP0qfaeuijKHd4bgvTA1T09NW3
OKrBSNZ3Y4gIR37fw91DQytArCanxP8oyYHKcd6N113B/M9ljyuGXKQaxa88
QlhjpoZ2+tYMGmS76FgnUzwws24ZfOU5Q87Ycq59sjMSeb/GnqQoo2UO+dnc
I65YYan4yD8/EMQF6bIXKWzE6FeiNEVdCe+b7WRD5JB++OyTt7ttIZfqaMHZ
74gUjiiRu4gJXKnjzdNJNkjhaxxLMPcE+Y+zNaY6GRAXISdvOkOSv2Q4a38k
S/ab54pPyXZMmEqtCv42xx0pxvSa7FFvGMg8qqDEpyPp2rpzGqqOMKDtp0+1
ZgFfZ+RmTL4RRisV2ho+ZOBQ+7y50cl+6MvJtiq/Ksn3F+Ak8YABC2SoJ3Sy
JP2YbmOZr3EHwW2z8euv2SD1p1/+0wcmVrgvTjwa64E45r1+hYs2kHo0Ys8J
jSV5auERrHdBYavZt25/FtC85R71yPgAJa4nOTMGQHCzRfS+JQhh5EzWkhgv
2DbEx9BGb8S0kb0lymbIp7mrcRLlkMJof0b9YAHcqyb3Hfv9QUidXPpWzEGC
fUHp3c45QGroK7ol6QPI80yaJL7gbnvw7yF5yb4tFagaFGUPpTHXE5N+2CFM
0T4cu88Ekff4mpgEyd6iFnP2k74kr0T+F4LFpojp1oH7XLXxf+7xTE4=
     "]]->StructuredArray[QuantityArray,{251,2},StructuredArray`StructuredData[QuantityArray,{{5.515519990456641,4.628070789743083},{-4.500960765126835,-25.526216958076432`},{7.56,0},{0,0},{5.58,-9.664843506234336},{1.3127802231619932`,-7.445146612772292},{-4.136639992842482,-3.4710530923073124`},{-7.2,0},{-6.016492026666007,-7.170175987593634},{-21.980909047232483`,-3.875827325525885},{-17.25275651762928,-6.279489831459277},{-17.25275651762928,-6.279489831459277},{8.795522930556102,-3.201308541528259},{-17.25275651762928,-6.279489831459277},{-29.52,0},{-17.25275651762928,-6.279489831459277},{-2.5630471023638917`,14.53576243446019},{5.515519990456641,4.628070789743083},{-35.45307910843949,6.251334396009492},{0,-5.4},{-12.782534959858314`,7.38},{12.178416365385374`,4.432581057500667},{-13.869863082800007`,5.04821731548687},{5.4,0},{1.8469087739586112`,-5.074340152243906},{-27.72,0},{17.09811197041559,-14.347019448203556`},{-35.45307910843949,6.251334396009492},{-21.980909047232483`,-3.875827325525885},{-1.900099746648619,-5.220481148628529},{10.835198140557186`,-29.769462226497577`},{18.081070345304138`,3.1881805419648406`},{0,-5.4},{0,-5.4},{-16.308416389882165`,-2.875613822164366},{20.34,-35.22991342595096},{-22.665386013356112`,8.24952585701513},{-16.308416389882165`,-2.875613822164366},{-9.664843506234336,-5.58},{5.58,-9.664843506234336},{-29.52,0},{-35.45307910843949,6.251334396009492},{3.125667198004746,17.726539554219745`},{18.081070345304138`,3.1881805419648406`},{-5.515519990456641,-4.628070789743083},{4.136639992842482,3.4710530923073124`},{-3.875827325525885,21.980909047232483`},{-3.78,6.547152052610356},{-19.32968701246867,11.16},{-12.782534959858314`,7.38},{-17.25275651762928,-6.279489831459277},{2.5856722835420554`,7.104076213141467},{-17.25275651762928,-6.279489831459277},{0,18.36},{-4.500960765126835,-25.526216958076432`},{-34.843802378741486`,-12.682106914515796`},{-8.24952585701513,-22.665386013356112`},{-20.88853273928066,12.06},{-3.6,-6.235382907247958},{16.546559971369927`,13.88421236922925},{-16.308416389882165`,-2.875613822164366},{-20.88853273928066,12.06},{0,-5.4},{-17.09811197041559,14.347019448203556`},{0,22.32},{0,0},{-12.782534959858314`,7.38},{-2.875613822164366,16.308416389882165`},{2.500533758403797,-14.181231643375796`},{-15.504037145639327`,18.47699196802975},{-17.25275651762928,-6.279489831459277},{-19.282492578526842`,-7.018253341042722},{0,-5.4},{-3.78,6.547152052610356},{-17.25275651762928,-6.279489831459277},{10.835198140557186`,-29.769462226497577`},{-38.65937402493734,-22.32},{2.875613822164366,16.308416389882165`},{0,9.36},{5.515519990456641,4.628070789743083},{-3.816944799514463,10.486969647970739`},{5.4,0},{0,0},{-17.25275651762928,-6.279489831459277},{-2.5630471023638917`,14.53576243446019},{7.104076213141467,2.5856722835420554`},{-14.53576243446019,2.5630471023638917`},{-17.25275651762928,-6.279489831459277},{8.105997779422344,-4.68},{-17.09811197041559,14.347019448203556`},{9.927935982821955,-8.33052742153755},{-16.308416389882165`,-2.875613822164366},{-20.88853273928066,12.06},{0,-5.4},{0,-5.4},{-3.4710530923073124`,4.136639992842482},{-17.25275651762928,-6.279489831459277},{-17.25275651762928,-6.279489831459277},{10.990454523616242`,1.9379136627629425`},{5.515519990456641,4.628070789743083},{36.51667148169267,-6.438874427889776},{8.795522930556102,-3.201308541528259},{1.8,-3.117691453623979},{-12.782534959858314`,7.38},{-3.4710530923073124`,-4.136639992842482},{-20.88853273928066,12.06},{-34.47912738358597,41.090623928901984`},{-7.142013131227138,8.511519807494965},{-14.53576243446019,2.5630471023638917`},{-7.56,0},{5.58,-9.664843506234336},{0,0},{5.515519990456641,4.628070789743083},{5.58,-9.664843506234336},{-4.136639992842482,3.4710530923073124`},{-17.25275651762928,-6.279489831459277},{-4.500960765126835,-25.526216958076432`},{-6.48145,-11.226200706717298`},{-6.016492026666007,-7.170175987593634},{0,0},{-8.24952585701513,-22.665386013356112`},{0,-5.4},{-13.869863082800007`,5.04821731548687},{7.38,12.782534959858314`},{1.3127802231619932`,-7.445146612772292},{-4.500960765126835,-25.526216958076432`},{0,-5.4},{-14.76,0},{10.835198140557186`,-29.769462226497577`},{-5.4,-9.353074360871938},{-29.52,0},{7.090615821687898,1.2502668792018985`},{5.58,-9.664843506234336},{18.081070345304138`,3.1881805419648406`},{-17.25275651762928,-6.279489831459277},{-13.869863082800007`,5.04821731548687},{-2.5630471023638917`,14.53576243446019},{10.635923732531847`,1.8754003188028476`},{2.3140353948715413`,2.7577599952283207`},{-17.25275651762928,-6.279489831459277},{41.090623928901984`,-34.47912738358597},{-17.25275651762928,-6.279489831459277},{0,-5.4},{-7.090615821687898,1.2502668792018985`},{9.217800568194267,1.6253469429624678`},{5.515519990456641,4.628070789743083},{0,0},{-21.980909047232483`,3.875827325525885},{-29.769462226497577`,10.835198140557186`},{-17.25275651762928,-6.279489831459277},{4.136639992842482,3.4710530923073124`},{11.80158051384486,14.064575975664436`},{0,-5.4},{-17.25275651762928,-6.279489831459277},{11.80158051384486,14.064575975664436`},{9.523541225115766,11.34971446925078},{9.927935982821955,8.33052742153755},{-6.547152052610356,-3.78},{18.081070345304138`,3.1881805419648406`},{20.52,0},{3.201308541528259,8.795522930556102},{-12.782534959858314`,7.38},{-2.5630471023638917`,14.53576243446019},{-4.500960765126835,-25.526216958076432`},{10.644562816409088`,12.685695978050274`},{27.305617659484184`,-32.54156794369418},{13.86,-24.006224192904636`},{6.547152052610356,3.78},{0,0},{3.201308541528259,8.795522930556102},{40.218219751749324`,23.22},{-5.663853573473073,15.561309800214643`},{-20.88853273928066,12.06},{-4.2561429259690415`,3.571327959418412},{-17.25275651762928,-6.279489831459277},{0,0},{14.064575975664436`,11.80158051384486},{-4.500960765126835,-25.526216958076432`},{-7.633889599028926,20.973939295941477`},{0,-5.4},{-22.44737846609265,-12.96},{0,-10.8},{17.77084128565668,10.26},{-12.782534959858314`,7.38},{-20.88853273928066,12.06},{-17.25275651762928,-6.279489831459277},{-1.6253469429624678`,9.217800568194267},{40.218219751749324`,23.22},{-20.88853273928066,12.06},{-17.25275651762928,-6.279489831459277},{-17.25275651762928,-6.279489831459277},{-35.45307910843949,6.251334396009492},{11.223689233046326`,6.48},{7.56,0},{3.4710530923073124`,-4.136639992842482},{-6.547152052610356,-3.78},{7.56,0},{-6.279489831459277,-17.25275651762928},{5.515519990456641,4.628070789743083},{-22.665386013356112`,-8.24952585701513},{36.51667148169267,-6.438874427889776},{6.48,11.223689233046326`},{0,0},{-1.6253469429624678`,9.217800568194267},{-8.28,14.341380686670302`},{0,0},{-3.5632606057254104`,20.208255091810507`},{-8.795522930556102,3.201308541528259},{-24.268287958009225`,-20.363511474869565`},{-7.018253341042722,19.282492578526842`},{3.78,-6.547152052610356},{-12.76596442152195,2.250983962278651},{-3.5632606057254104`,20.208255091810507`},{-6.016492026666007,-7.170175987593634},{14.341380686670302`,-8.28},{-29.52,0},{5.4,0},{-20.88853273928066,12.06},{-7.56,0},{-21.980909047232483`,-3.875827325525885},{-5.58,9.664843506234336},{-22.44737846609265,-12.96},{28.404927950851704`,23.834564567176873`},{5.58,-9.664843506234336},{-29.52,0},{-17.25275651762928,-6.279489831459277},{-18.36,0},{-20.88853273928066,12.06},{-8.33052742153755,-9.927935982821955},{-14.53576243446019,2.5630471023638917`},{4.8594743292302365`,-5.791295989979473},{-29.52,0},{-17.25275651762928,-6.279489831459277},{-12.782534959858314`,7.38},{-17.25275651762928,-6.279489831459277},{9.353074360871938,5.4},{-22.44737846609265,-12.96},{0,-5.4},{5.58,-9.664843506234336},{-4.432581057500667,12.178416365385374`},{0,0},{9.927935982821955,-8.33052742153755},{7.38,-12.782534959858314`},{-2.5630471023638917`,14.53576243446019},{0,-14.4},{-17.25275651762928,-6.279489831459277},{14.341380686670302`,-8.28},{2.500533758403797,-14.181231643375796`},{-20.88853273928066,12.06},{5.58,-9.664843506234336},{-2.5630471023638917`,14.53576243446019}},"Hours"^(-1) "Kilometers",{{1},{2}}]]];
params={{{{-90,90},{-20,80}},{0,30},{0,0}},{{{0,90},{-40,-20}},{0,30},{0,0}},{{{-90,0},{-100,-20}},{0,-60},{-(Pi/2),0}},{{{0,90},{-100,-40}},{0,-100},{-(13 (Pi/18)),0}},{{{0,90},{-180,-100}},{0,-100},{-(13 (Pi/18)),0}},{{{-90,0},{-180,-100}},{0,-160},{-(19 (Pi/18)),0}},{{{0,90},{80,180}},{0,30},{0,0}},{{{-90,0},{80,180}},{0,140},{11 (Pi/18),0}}};
parts=Table[GeoVectorPlot[data,GeoRange->p[[1]],GeoProjection->{"GoodeHomolosine","Centering"->p[[2]],"GridOrigin"->p[[3]],"ReferenceModel"->1},GeoRangePadding->None,Sequence[StreamStyle->Red,GeoGridLines->Quantity[10,"AngularDegrees"],GeoBackground->"CountryBorders"]],{p,params}];
Show[Graphics@@@parts,PlotRange->All]
parts=Table[GeoStreamPlot[data,GeoRange->p[[1]],GeoProjection->{"GoodeHomolosine","Centering"->p[[2]],"GridOrigin"->p[[3]],"ReferenceModel"->1},GeoRangePadding->None,Sequence[StreamStyle->Red,GeoGridLines->Quantity[10,"AngularDegrees"],GeoBackground->"CountryBorders"]],{p,params}];
Show[Graphics@@@parts,PlotRange->All]

Calculating with vectors

In Mathematica, vectors are entered as lists of numbers wrapped in curly braces: {...}. Here are two 2D vectors v and w. By default, we imagine them as arrows going from the origin out to the two points shown in the figure.

v = {3, 1}
w = {-2, 5}
ListPlot[{v, w}]

There are three basic things you can do with vectors: ask whether they’re equal, add them, and scale them by numbers.

v == w
v + w
7 * v

Using those three basic tasks, you can build up more complicated ideas. For example, subtracting two vectors can be expressed in terms of addition and scaling.

v - w
v + (-1) * w

So far, we’ve just done arithmetic with vectors. But we can also do algebra, by which I simply mean arithmetic where some of the numbers are variable or unknown. For example, this calculation verifies that subtraction can be expressed in terms of addition and scaling for any two 2D vectors.

Clear[v1, v2, w1, w2];
v = {v1, v2}
w = {w1, w2}
v - w
v + (-1) * w
v - w == v + (-1) * w

A linear combination is a sum of scaled vectors. Here are a concrete example and an abstract example.

3 * {1, 0} + 5 * {0, 1}
Clear[a, b];
a * v + b * w

For a more thorough list of the algebraic properties that vectors obey, see Section 1.3 (page 29) of our textbook.

Linear systems in terms of vectors

What do vectors have to do with systems of linear equations? Everything! For example, here is a linear system from our previous Mathematica notebook.

2 x + 3 y == 0
-5 x + 5 y == 5

That linear system is the same as saying that the vectors below, called “left” and “right”, are equal.

left = {2 x + 3 y, -5 x + 5 y}
right = {0, 5}
left == right

Moreover, the vector left is a linear combination of two other vectors.

left
x * {2, -5} + y * {3, 5}

Vectors are closely related to matrices, which we will study next. Once we get comfortable with the language of vectors and matrices, our view of linear algebra shifts a lot. In many ways, it gets simpler.

Higher-dimensional vectors

Thus far we’ve focused on 2D and 3D vectors. But if you think of vectors as lists of numbers that can be added and scaled, then there is no reason why you can’t work with vectors of higher dimension. For example, here is some arithmetic with 7D vectors.

u = {4, -3.1, 2, 0, 0, 1, 5}
v = {0, 1, -1.1, 0, 4, 6, 1}
3 * u
-2 * v
3 * u - 2 * v

You can think of those vectors as arrows in 7D space, pointing from the 7D origin to some 7D points. Using such vectors, you can do geometry in seven dimensions.

At this point, students often ask me: Are higher dimensions real? Do they actually exist? My answer is: They certainly exist as mathematical concepts. We just used 7D, after all.

And then students ask: Okay, but are higher dimensions just a fantasy for mathematicians, or are they actually useful to real people? My answer is: Yes, higher dimensions are actually useful! Here are three examples.

First, as of July 2024 there are 2223 stocks listed on the New York Stock Exchange. Each of those stocks has a price, which changes from day to day. If we list these prices in some agreed-upon order, then we get 2223D vector. As the stock prices change, this vector moves around in 2223-dimensional space. If v is the vector one day and w is the vector the next day, then w - v is the change in stock prices between those days. Quantitative financial analysts (“quants”) build sophisticated mathematical models of the stock market using high-dimensional vectors.

Second, large language models such as ChatGPT work by converting words (or pieces of words) into vectors. These vectors inhabit a space of hundreds or thousands of dimensions. The axes of this space are different kinds of meaning that words can carry. Two words with similar meaning, such as “dog” and “canine”, manifest as vectors that are close to each other in this space (even though “dog” and “canine” are not very similar, as words spelled in letters). See the Ars Technica article linked on our course web site.

Third, we have already explored, in one of our Discussion Problems, how the Google PageRank algorithm assigns a value to each web page, by setting up a linear equation for each web page. Because there are billions of web pages, their values form a vector of billions of dimensions. Do you use Google every day? Then you use billion-dimensional vectors every day.

At this point, students often ask: Okay, but how do you picture such vectors? My answer is: You can’t. Well, sometimes there are some mental tricks you can pull, to pretend that the vectors are of lower dimension. We might talk about some of these tricks later in the course. But for the most part you have to rely on your knowledge of how the vectors behave algebraically. We use low dimensions to gain intuition for vectors, and then we apply that intuition in high dimensions.