3D Coordinates and Vectors

MAT 229, Spring 2025

Strang’s Calculus
	Volume 3, Section 2.1: Vectors in the Plane
	Volume 3, Section 2.2: Vectors in Three Dimensions

Stewart’s Calculus
	Section 12.1: Three-Dimensional Coordinate Systems

Boelkins/Austin/Schlicker’s Active Multivariable Calculus
	Section 9.2: Vectors

2D Coordinates

For points in the plane we have Cartesian coordinates (x,y) and polar coordinates (r,θ). Two numbers are needed to address any point.

(source)

Question

How are locations on Earth’s surface typically represented?

(source)

Can you find Cincinnati on the globe above? Can you explain the latitude and longitude given by Mathematica against the values given on the globe?

GeoPosition[Entity["City",{"Cincinnati","Ohio","UnitedStates"}]]

3D Coordinates

Question

What information is needed to locate the position of a flying plane?

In addition to latitude and longitude, we also need altitude -- the three tude-ges. We need to be careful: is altitude the height above the average radius of the Earth, or above the local surface of the Earth? From a mathematical standpoint, it’s probably best to think of it as the height from the center of the Earth....

Cartesian  coordinates in 3D

Start with the x-y plane. Add depth with the z-axis coming out perpendicularly from the plane (that is, at an angle of 90°). A point in space has coordinates (x,y,z) where

z is the distance of the point from the x-y plane

y is the distance of the point from the x-z plane

x is the distance of the point from the y-z plane

Graphics3D[{PointSize[0.03],Point[{2,1,3}],Text[Style[{2,1,3},FontSize->18],{2,1,3},{-1.5,1.5}],Dashing[{0.02}],Line[{{2,1,3},{2,1,0}}],Line[{{2,1,3},{2,0,3}}],Line[{{2,1,3},{0,1,3}}],Text[Style[2,FontSize->18],{1,1,3},{1,1}],Text[Style[1,FontSize->18],{2,0.5,3},{1,1}],Text[Style[3,FontSize->18],{2,1,1.5},{1,1}]},Axes->True,AxesStyle->Thick,AxesLabel->{Style[x,FontSize->18],Style[y,FontSize->18],Style[z,FontSize->18]},PlotRange->{{0,4},{0,4},{0,4}}]

Questions

The equation z=3 is the set of points (x,y,z) with z=3. What is the shape of this set?

The equation x=2 is the set of points (x,y,z) with x=2. What is the shape of this set?

Give an equation for the plane that is parallel to the y-z plane and is 5 units from it in the positive x direction.

Sketch the equation x+y=3.

ParametricPlot3D[{x,3-x,z},{x,0,4},{z,0,4},AxesLabel->{x,y,z},
PlotRange->{{0,4},{0,4},{0,4}}]

What does the fact that the equation is independent of z tell you?

The equation y>1 is the set of points (x,y,z) with y>1. What is the shape of this set?

RegionPlot3D[y>1,{x,0,4},{y,0,4},{z,0,4}]

What does the fact that this equation is independent of both x and z tell you?

Distance

Questions

We want to find the distance between (1,2,0) and (2,1,3).

Draw a box with one corner at (1,2,0) and the diagonal corner at (2,1,3).

Graphics3D[
{
PointSize[0.04],
Point[{2,1,3}],
Text[{2,1,3},{2,1,3},{-1.2,1.2}],
Point[{1,2,0}],
Text[{1,2,0},{1,2,0},{-1.2,1.2}],
Line[{{2,1,3},{1,2,0}}]
},
Axes->True,
AxesStyle->Thick,
AxesLabel->{x,y,z},PlotRange->{{1,2},{1,2},{0,3}},BaseStyle->FontSize->18]

What are the dimensions of this box?

What is the distance between the two points?

3D distance

The distance between points ((Subscript[x, 1]),(Subscript[y, 1]),(Subscript[z, 1])) and ((Subscript[x, 2]),(Subscript[y, 2]),(Subscript[z, 2])) is
	(Sqrt[((((Subscript[x, 1])-(Subscript[x, 2])))^2)+((((Subscript[y, 1])-(Subscript[y, 2])))^2)+((((Subscript[z, 1])-(Subscript[z, 2])))^2)]).
Notice how this compares to the distance formula for points in the plane.

“In the plane” might mean in the x-y plane -- that is, when z=0 for the points. In this case, the formula reduces to (Sqrt[((((Subscript[x, 1])-(Subscript[x, 2])))^2)+((((Subscript[y, 1])-(Subscript[y, 2])))^2)]), just as we would hope.

Questions

Consider the triangle whose vertices are (3,-2,-3),  (7,0,1), and (1,2,1).

Graphics3D[
{
PointSize[0.03],
Point[{3,-2,-3}],
Text[Style[{3,-2,-3},FontSize->18],{3,-2,-3},{-1.5,1.5}],
Point[{7,0,1}],
Text[Style[{7,0,1},FontSize->18],{7,0,1},{-1.5,1.5}],
Point[{1,2,1}],
Text[Style[{1,2,1},FontSize->18],{1,2,1},{-1.5,1.5}],
Line[{{7,0,1},{3,-2,-3}}],
Line[{{7,0,1},{1,2,1}}],
Line[{{1,2,1},{3,-2,-3}}]
},
Axes->True,
AxesStyle->Thick,
AxesLabel->{Style[x,FontSize->18],Style[y,FontSize->18],Style[z,FontSize->18]},PlotRange->{{1,7},{-2,2},{-3,1}}]

Is it a right triangle?

distance3D[p1_,p2_]:=Norm[p1-p2]
distance3D[{3,-2,-3},{7,0,1}]
distance3D[{3,-2,-3},{1,2,1}]
distance3D[{1,2,1},{7,0,1}]

Is it an isosceles triangle?

Questions

Consider the set of points (x,y,z) that are a distance of 2 from the origin (0,0,0).

What is an equation that x,y,z must satisfy for (x,y,z) to be in this set?

What is this shape?

ContourPlot3D[x^2+y^2+z^2==4,{x,-3,3},{y,-3,3},{z,-3,3}]

Spheres

From the distance formula, we can deduce an equation of the sphere centered on C(a,b,c) of radius r. The sphere is the set of all points equidistant, at a distance r, from the center.

That is, a sphere is the set of points that are the same distance, the radius, from a specified point -- the sphere’s center. If the radius is r and the center has coordinates (a,b,c), then this is an equation for the sphere:
	(((x-a))^2)+(((y-b))^2)+(((z-c))^2)=(r^2).

Questions

The equation (((x-2))^2)+(y^2)+(((z+3))^2)=4 represents a particular sphere.

What is its center?

Let’s re-write this equation:	 (((x-2))^2)+(((y-0))^2)+(((z+3))^2)=(2^2)

What is its radius?

Describe its intersections with each of the coordinate planes.

Show[
ContourPlot3D[(x-2)^2+y^2+(z+3)^2==2^2,{x,0,4},{y,-2,2},{z,-5,0}],
ParametricPlot3D[{x,0,z},{x,0,4},{z,-5,0}],
ParametricPlot3D[{0,y,z},{y,-2,2},{z,-5,0}],
ParametricPlot3D[{x,y,0},{x,0,4},{y,-2,2}],
Axes->True,
AxesLabel->{Style[x,FontSize->18],Style[y,FontSize->18],Style[z,FontSize->18]},PlotRange->{{0,4},{-2,2},{-5,0}},BoxRatios->Automatic
]

The equation (x^2)+(y^2)+(z^2)+2x-4y-10z=0 represents a sphere.

radius=Sqrt[30];
ContourPlot3D[
x^2+y^2+z^2+2x-4y-10z==0,
{x,-1-radius,-1+radius},{y,2-radius,2+radius},{z,5-radius,5+radius},
Axes->True,
AxesLabel->{x,y,z},
PlotRange->{{-1-radius,-1+radius},{2-radius,2+radius},{5-radius,5+radius}},BaseStyle->FontSize->18
]

What is its center?

What is its radius?

Vectors

Definition

A vector is an object with direction and magnitude.

Example

While driving at one particular instance my speedometer shows that I’m going 53 mph and my GPS shows I’m headed 30° north of east. My velocity vector has magnitude (a speed of 53 mph) and direction (30° north of east). This is a 2D vector.

I’m standing at a particular point on a mountaintop. I need to tell a helicopter pilot how to reach me. I give her a direction and a distance to fly to reach me. The position vector from the helicopter to me has  magnitude (the distance to fly to me) and the direction. This is a 3D vector, representing the distance and direction “as the crow flies”.

I need to move my refrigerator. To overcome friction I need to pull with a force of 30 pounds and it needs to be away from the back wall in a perpendicular fashion. I need to pull with a force vector that has magnitude (30 pounds) and direction (directly away from the wall).

(source)

Vector graphics

Represent a vector with an arrow whose length is the magnitude of the vector and it points in the direction of the vector. It is useful to think of the arrow as having an initial point ((Subscript[x, 0]),(Subscript[y, 0]),(Subscript[z, 0])) and a terminal point ((Subscript[x, 1]),(Subscript[y, 1]),(Subscript[z, 1])) where the arrow starts at the initial point and has the arrowhead at the terminal point. Two-dimensional examples are shown above, in the orbit around the sun. But we can do the same thing in three dimensions:

Graphics3D[{Arrow[{{0,1,2},{2,1,3}}]},Boxed->True,Axes->True]

Questions

Let (-2,-1) be the initial point of the arrow and (4,3) be the terminal point of the arrow where the arrowhead is.

Draw a rectangle with the vector as one of the diagonals.

What are the dimensions of the rectangle?

What is the length of the arrow?

Find the direction of the vector as an angle with the positive x-direction.

angle=N[ArcTan[2/3]]

radians2degrees[angle_]:=angle*180/Pi (* angle*360/(2Pi)*)
radians2degrees[angle]

Vector notation

Just as we give numbers names, like x=1, and functions names, like f(x)=(x^2). We give vectors names.

To easily distinguish vectors from numbers, often either a little arrow is drawn over the vector’s name as in (Overscript[v, ->]) or it is drawn in bold as in v.

The magnitude of a vector is denoted with the same notation used to denote the absolute value of a number. The notation |(Overscript[v, ->])| denotes the magnitude of vector (Overscript[v, ->]).

Vector components

The vector components for a vector are the dimensions of the rectangle if the vector is 2D, dimensions of the box if the vector is 3D. Each component comes from subtracting the corresponding coordinate of the initial point from the same coordinate of the terminal point, (terminal-initial).

Questions

What are the components of the vector whose initial point (1,2) and terminal point (3,1)?

vector={3,1}-{1,2}

What is the magnitude of this vector?

normVector[vector_]:=Sqrt[Dot[vector,vector]] 
normVector[vector]
(* Magnitude is called norm; we'll define both soon in the context of vector products. *)

Find the direction of this vector as an angle with the positive x-axis.

angle=N[ArcTan[vector[[2]]/vector[[1]]]]
radians2degrees[angle]

What are the components of the vector whose initial point (4,2,-3) and terminal point (1,2,3)?

vector={1,2,3}-{4,2,-3}

What is the magnitude of this vector?

normVector[vector]
N[%]

More vector notation and special Unit Vectors

A vector is written in component form in two different ways. If vector v has x-component a, y-component b, and z-component c:

(Overscript[u, ->])=⟨a,b,c⟩

(Overscript[u, ->])=a (Overscript[i, ->])+b (Overscript[j, ->])+c (Overscript[k, ->])

(source)

The vectors (Overscript[i, ->]),(Overscript[j, ->]), and (Overscript[k, ->]) are called unit vectors, because they have unit length. They are also mutually perpendicular, and so they comprise what is called an orthogonal basis for 3-space. That’s a mouthful. They’re orthogonal because they’re mutually perpendicular; they’re a basis because one can write any vector in 3-space in terms of them.

For vectors in the plane there are only two components. Furthermore, since there are no z-components, only  (Overscript[i, ->]) and (Overscript[j, ->]) appear when writing planar vectors.  The vectors (Overscript[i, ->]) and (Overscript[j, ->]) are an orthogonal basis for 2-space.

Questions

Draw vector ⟨1,-2⟩ with its initial point at (0,0).

Draw vector 2(Overscript[i, ->])+3(Overscript[j, ->]) with its initial point at (-1,1).

uu={1,-2};
vv={2,3}+{-1,1};
Graphics[{
Arrow[{{0,0},uu}],
Arrow[{{-1,1},vv}]
},Axes->True]

Vector arithmetic

Arithmetic is done on vectors only when it has geometric significance.

Scalar multiplication

A scalar is just a single number as opposed to a vector that is multiple information packaged in one object. Scalar multiplication:
	scalar * vector produces another vector.

Geometric significance

Let (Overscript[v, ->]) be a vector and λ be a scalar, the vector λ (Overscript[v, ->]) has the following length and magnitude.

Magnitude: |λ (Overscript[v, ->])|= |λ|| (Overscript[v, ->])|. In other words the magnitude of the scalar product is the absolute value of the scalar times the magnitude of the original vector.

Direction:  the direction of λ (Overscript[v, ->]) is parallel to the direction of (Overscript[v, ->]).

If λ>0, the direction of  λ (Overscript[v, ->]) is the same as the direction of  (Overscript[v, ->]).

If λ<0, the direction of  λ (Overscript[v, ->]) is the exact opposite of the direction of  (Overscript[v, ->]).

Questions

Let λ be the scalar 2 and (Overscript[v, ->])=⟨1,2⟩. What should the components of 2(Overscript[v, ->]) be? What should the components of (-2)(Overscript[v, ->]) be?

In general, how should λ⟨a,b,c⟩ be computed?

Given the three vectors (Subscript[(Overscript[v, ->]), 1])=⟨4,12,-8⟩,(Subscript[(Overscript[v, ->]), 2])=⟨-3,-9,6⟩,(Subscript[(Overscript[v, ->]), 3])=⟨2,2,-6⟩, are any parallel to each other?

v1={4,12,-8}
v2={-3,-9,6}
v3={2,2,-6}
Cross[v1,v2] (* the cross product of vectors is a test for parallel vectors: if it's the zero vector, then the vectors are parallel. *)
Cross[v1,v3]
Cross[v3,v2]

Vector addition

Component form

If (Overscript[u, ->])=⟨a,b,c⟩ and (Overscript[v, ->])=⟨e,f,g⟩, then (Overscript[u, ->])+(Overscript[v, ->])=⟨a+e,b+f,c+g⟩

Geometric significance

Equivalent forms:

Draw vector (Overscript[u, ->]). Place the initial point of vector (Overscript[v, ->]) at the terminal point of (Overscript[u, ->]). Draw the vector sum with its initial point at the initial point of (Overscript[u, ->]) and its terminal point at the terminal point of (Overscript[v, ->]).

Clear[u, v]; uu = {2, 1}; vv = {1, -1};
Graphics[{Arrow[{{0, 0}, uu}], Arrow[{uu, uu + vv}], Arrow[{{0, 0}, uu + vv}], Text[u, .5 uu, {1, -1}], Text[v, uu + .5 vv, {-1, -1}], Text[u + v, .5 (uu + vv), {0, 1}]}, BaseStyle -> {FontSize -> 18}]

Draw vectors (Overscript[u, ->]) and (Overscript[v, ->]) with initial points together. The two vectors form two sides of a parallelogram. Complete the parallelogram. Draw the vector sum from the initial points of  (Overscript[u, ->]) and (Overscript[v, ->]) to the opposing vertex of the parallelogram.

Clear[u,v];uu={2,1};vv={1,-1};
Graphics[{Arrow[{{0,0},uu}],Arrow[{{0,0},vv}],Arrow[{{0,0},uu+vv}],Dashing[{0.02}],Line[{uu,uu+vv,vv}],Text[u,.5uu,{1,-1}],Text[v,.5vv,{-1,-1}],Text[u+v,.5(uu+vv),{0,1}]},BaseStyle->{FontSize->18}]

Questions

Let (Overscript[u, ->])=⟨1,1⟩ and (Overscript[v, ->])=⟨1,2⟩.

Draw (Overscript[u, ->])+(Overscript[v, ->]) as in the first geometric significance.

Clear[uu, vv]; uu = {1, 1}; vv = {1, 2};
Graphics[{
Arrow[{{0,0},uu}],
Arrow[{uu,uu+vv}],
Arrow[{{0,0},uu+vv}]
},Axes-> True]

Draw (Overscript[u, ->])+(Overscript[v, ->]) as in the second geometric significance.

Clear[uu, vv]; uu = {1, 1}; vv = {1, 2};
Graphics[{Arrow[{{0,0},uu}],Arrow[{{0,0},vv}],Arrow[{{0,0},uu+vv}],Dashing[{0.02}],Line[{uu,uu+vv,vv}]},Axes->True]

Questions

Using the same two vectors, what is the geometric significance of (Overscript[u, ->])-(Overscript[v, ->])? Draw it.

Clear[uu, vv]; uu = {1, 1}; vv = -{1, 2};
Graphics[{
Arrow[{{0,0},uu}],
Arrow[{uu,uu+vv}],
Arrow[{{0,0},uu+vv}]
},Axes-> True]

Questions

Consider the triangle with vertices A((Subscript[a, 1]),(Subscript[a, 2])),B((Subscript[b, 1]),(Subscript[b, 2])),C((Subscript[c, 1]),(Subscript[c, 2])).

Graphics[{Line[{{0,0},{1,2},{2,-.5},{0,0}}],Text[A,{-.1,-.1}],Text[B,{1,2+.1}],Text[C,{2.1,-.6}]},BaseStyle->{Large}]

What is vector (Overscript[A B, ->]) in component form? What is vector (Overscript[B C, ->]) in component form?

What is the vector sum (Overscript[A B, ->])+(Overscript[B C, ->]) in component form?

Geometrically what is the vector sum (Overscript[A B, ->])+(Overscript[B C, ->])?

Question

Why is it true that the line joining the midpoints of two sides of a triangle must be parallel to the third side?

Question

There are the two component notations for vectors, (Overscript[u, ->])=⟨a,b,c⟩ and (Overscript[u, ->])=a (Overscript[i, ->])+b (Overscript[j, ->])+c (Overscript[k, ->]). Expressions (Overscript[i, ->]),(Overscript[j, ->]),(Overscript[k, ->]) are vectors themselves. What are they?

Unit vectors

Definition

A unit vector is a vector with magnitude 1. Its magnitude is fixed, but its direction can be any direction.

Questions

Let (Overscript[u, ->])=⟨1,2⟩

Is (Overscript[u, ->]) a unit vector?

Find a scalar λ such that λ (Overscript[u, ->]) is a unit vector.

Find a general method for taking a vector and finding a unit vector pointing in the same direction.

Does this work for all vectors?

Slopes and vectors

Since the slope of a line is (rise/run) and a vector has components ⟨run,rise⟩, the slope associated with planar vector ⟨a,b⟩ is m=(b/a).

Questions

What are the unit vectors parallel to the tangent line to the curve y=2sin(x) at the point (π/6,1)?

What are the unit vectors perpendicular to the tangent line to the curve y=2sin(x) at x=π/6?