Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Space and vectors

The graph of a function of two variables is a surface in three dimensional space, and nothing in the calculus of one variable says how far apart two points in space are, which way a direction points, or what equation a flat plane has.

The previous lesson met that gap at its end: the slope on a hillside depends on the direction walked, and whatever replaces the tangent line must be a tangent plane. This lesson builds the geometry those ideas need, entirely by computing with coordinates, and assumes only Pythagoras and school trigonometry. Readers who know vectors from Linear Algebra will recognise the dot product; the cross product, and the lines and planes it makes easy, are new.

Coordinates in space

Take three mutually perpendicular number lines meeting at an origin, with the x axis towards you, the y axis to the right and the z axis up, so that, as in the previous lesson, heights are measured along z. A point is an ordered triple (x,y,z). The arrangement is right-handed: curl the fingers of the right hand from the positive x axis to the positive y axis and the thumb points along the positive z axis. Distance does not care about this convention, but the cross product later on does.

Distance comes from Pythagoras applied twice. Between P=(x1,y1,z1) and Q=(x2,y2,z2), the horizontal distance across the floor is (x2-x1)2+(y2-y1)2, and the vertical rise z2-z1 is perpendicular to it, so the two are the legs of a right triangle whose hypotenuse runs from P to Q. Squaring and adding,

|PQ|=(x2-x1)2+(y2-y1)2+(z2-z1)2

From (1,2,3) to (4,6,15) the differences are 3, 4 and 12, and the distance is 169=13. The inside of a standard twenty foot shipping container measures 5.898 by 2.352 by 2.393 metres, so the longest pipe that fits, corner to opposite corner, is 34.786+5.532+5.726=6.786 metres.

The points at distance r from a centre (a,b,c) satisfy (x-a)2+(y-b)2+(z-c)2=r2, the equation of a sphere. Faced with x2+y2+z2-2x+4y-6z=2, complete the square in each variable to get (x-1)2+(y+2)2+(z-3)2=16: radius 4, centre (1,-2,3).

Vectors and components

A point says where; a vector says how far and which way. The displacement from (1,2,3) to (4,6,15) is written ⟨3,4,12⟩, with angle brackets to keep it apart from a point, and the same vector carries (10,10,10) to (13,14,22): a vector has length and direction but no fixed position. The vector from P to Q is head minus tail, ⟨x2-x1,y2-y1,z2-z1⟩. Vectors are printed in bold, 𝐚=⟨a1,a2,a3⟩.

Addition and scaling are componentwise. 𝐚+𝐛 is one displacement followed by the other, which is also how forces combine, and c𝐚 stretches the arrow by the factor c, reversing it when c<0. The length is the distance the arrow covers, |𝐚|=a12+a22+a32, and dividing a non-zero vector by its length gives a unit vector in the same direction: ⟨3,4,12⟩/13=⟨0.2308,0.3077,0.9231⟩. A unit vector is a pure direction, which is how later lessons will say "walk this way".

The unit vectors along the axes are 𝐢=⟨1,0,0⟩, 𝐣=⟨0,1,0⟩ and 𝐤=⟨0,0,1⟩, and every vector combines them: ⟨3,4,12⟩=3𝐢+4𝐣+12𝐤. Engineering texts favour this second notation; the two say the same thing.

The dot product and angles

The dot product multiplies matching components and adds, giving a number:

𝐚⋅𝐛=a1b1+a2b2+a3b3

Its meaning comes from the law of cosines. Put the tails of 𝐚 and 𝐛 together with angle θ between them; the third side of the triangle is 𝐚-𝐛, and the law says |𝐚-𝐛|2=|𝐚|2+|𝐛|2-2|𝐚||𝐛|cosθ. Compute the left side in components instead: each (a1-b1)2 expands to a12-2a1b1+b12, and the three together give |𝐚|2+|𝐛|2-2𝐚⋅𝐛. Comparing,

𝐚⋅𝐛=|𝐚||𝐛|cosθ

So the angle between two non-zero vectors follows from components alone. A positive dot product means an acute angle, a negative one an obtuse angle, and zero means the vectors are perpendicular. That last test is the one used most: ⟨2,-1,3⟩ and ⟨1,5,1⟩ are perpendicular because 2-5+3=0.

Example. A methane molecule has its carbon atom at the centre of a cube and its four hydrogen atoms at alternate corners, which with the carbon at the origin are (1,1,1), (1,-1,-1), (-1,1,-1) and (-1,-1,1). Find the angle between two carbon to hydrogen bonds.

Take 𝐚=⟨1,1,1⟩ and 𝐛=⟨1,-1,-1⟩. The dot product is 1-1-1=-1 and each length is 3, so cosθ=-1/3 and θ=109.47 degrees, the same for every pair by symmetry. Spectroscopy measures the H-C-H angle of methane as 109.5 degrees.

Now you. Find the angle between the long diagonal ⟨1,1,1⟩ of a unit cube and the diagonal ⟨1,1,0⟩ of its floor, to two decimal places.

Answer

The dot product is 2 and the lengths are 3 and 2, so cosθ=2/6=0.8165 and θ=35.26 degrees, the angle at which the long diagonal rises above the floor.

Projection and work

The dot product also splits a vector into a part along a direction and a part across it. If 𝐮 is a unit vector, 𝐛⋅𝐮=|𝐛|cosθ is the length of the shadow 𝐛 casts on the line of 𝐮, called the component of 𝐛 along 𝐮. Multiplying it by 𝐮 gives the projection, and what remains of 𝐛 is perpendicular to 𝐮.

A 20 kg box rests on a ramp rising 3 metres for every 4 of run, so the uphill direction is 𝐮=⟨4,0,3⟩/5. Gravity is 𝐅=⟨0,0,-196.2⟩ newtons, taking g=9.81 metres per second squared, and its component along the ramp is -196.2×3/5=-117.7 newtons, the pull needed to hold the box. The familiar mgsinα has fallen out of the arithmetic without a triangle of forces.

Work is the same computation: a constant force 𝐅 moving an object through a displacement 𝐝 does work W=𝐅⋅𝐝, since only the part of the force along the motion counts. For a 70 kg walker, gravity is ⟨0,0,-686.7⟩ newtons, and over a route with displacement ⟨300,400,120⟩ metres the work is W=-686.7×120, which is 82,404 joules of negative work. The horizontal components are multiplied by zero, which is why the contour map of the previous lesson, counting only height, is enough to reckon the effort of a climb.

The cross product

A plane is fixed by a point and the direction perpendicular to it, so tangent planes will need this: given 𝐚 and 𝐛, find 𝐧=⟨x,y,z⟩ perpendicular to both. That is two equations,

a1x+a2y+a3z=0,b1x+b2y+b3z=0

Multiply the first by b3 and the second by a3 and subtract: z cancels, leaving (a1b3-a3b1)x+(a2b3-a3b2)y=0, which x=a2b3-a3b2 and y=a3b1-a1b3 satisfy. Putting these into the first equation, two terms cancel and z=a1b2-a2b1 remains, and a direct check confirms that all three satisfy both equations. The result is the cross product:

𝐚×𝐛=⟨a2b3-a3b2,a3b1-a1b3,a1b2-a2b1⟩

The indices cycle 1→2→3→1: the first component uses the second and third entries, the second uses the third and first, the third uses the first and second. On the axes, 𝐢×𝐣=𝐤, which is where right-handedness enters: the cross product points along the right thumb when the fingers curl from 𝐚 to 𝐛. Swapping the factors flips every sign, so 𝐛×𝐚=-𝐚×𝐛, and parallel vectors have cross product 𝟎.

The length carries geometry. Expanding both sides in components shows |𝐚×𝐛|2=|𝐚|2|𝐛|2-(𝐚⋅𝐛)2; for ⟨1,2,3⟩ and ⟨4,5,6⟩ the cross product ⟨-3,6,-3⟩ has squared length 54, and 14×77-322=54. Writing the dot product as |𝐚||𝐛|cosθ and using 1-cos2θ=sin2θ,

|𝐚×𝐛|=|𝐚||𝐛|sinθ

which is base times height for the parallelogram with sides 𝐚 and 𝐛. A triangle is half of one: the triangle with corners (1,0,0), (0,2,0) and (0,0,3) has edges ⟨-1,2,0⟩ and ⟨-1,0,3⟩, whose cross product ⟨6,3,2⟩ has length 7, so its area is 3.5.

In mechanics, a force 𝐅 applied at position 𝐫 from a pivot produces the torque τ=𝐫×𝐅, pointing along the axis it tries to turn about, with length equal to the force times its perpendicular lever arm.

Example. A bicycle crank is 175 mm long. With x forward and z up, the pedal is at 𝐫=⟨0.14,0,0.105⟩ metres from the axle, and the rider presses straight down with 𝐅=⟨0,0,-600⟩ newtons. Find the torque.

As a check, |𝐫|=0.0196+0.011025=0.175. The components of 𝐫×𝐅 are 0×(-600)-0.105×0=0, then 0.105×0-0.14×(-600)=84, then 0.14×0-0×0=0. The torque is ⟨0,84,0⟩, of 84 newton metres along the axle. Only the crank's horizontal reach acts as lever arm against a vertical push, and 600×0.14=84 agrees.

Now you. A spanner runs from the bolt to 𝐫=⟨0.2,0.15,0⟩ metres, and a hand pulls its end with 𝐅=⟨0,60,80⟩ newtons. Find the torque and its magnitude, to two decimal places.

Answer

The components are 0.15×80-0×60=12, then 0×0-0.2×80=-16, then 0.2×60-0.15×0=12. So τ=⟨12,-16,12⟩ and |τ|=544=23.32 newton metres, short of the 0.25×100=25 a perpendicular pull would give.

Lines in space

In space a single equation in x, y and z cuts out a surface, so a line needs another description: a motion. Start at P0=(x0,y0,z0) and move in the direction 𝐯=⟨v1,v2,v3⟩; after time t the position is

x=x0+tv1,y=y0+tv2,z=z0+tv3

These parametric equations trace the whole line as t runs over the real numbers. The line through (1,2,3) and (4,6,15) is x=1+3t, y=2+4t, z=3+12t, at the first point when t=0, the second when t=1 and the midpoint (2.5,4,9) when t=12. Another starting point or a rescaled direction describes the same line, worth remembering when two answers look different.

Where a line meets anything is found by substitution. A pole 5 metres tall stands at the origin and sunlight travels in the direction ⟨2,1,-4⟩. The ray through the top is (2t,t,5-4t), which reaches the ground z=0 at t=1.25, the point (2.5,1.25,0). The shadow is 7.8125=2.795 metres long, and the sun stands arctan(5/2.795)=60.8 degrees above the horizon.

Two lines in the plane meet or are parallel; in space they can also be skew. The x axis (t,0,0) and the line (0,s,1) have directions 𝐢 and 𝐣, so they are not parallel, yet one lies at height 0 and the other at height 1 and they never meet, like a road and the railway bridge over it. To test two lines, give them separate parameters, set the coordinates equal, and see whether three equations in two unknowns have a solution.

Planes

A plane is fixed by a point P0=(x0,y0,z0) on it and a normal vector 𝐧=⟨a,b,c⟩ perpendicular to it. A point (x,y,z) lies in the plane exactly when its displacement from P0 is perpendicular to 𝐧, which by the dot product is

a(x-x0)+b(y-y0)+c(z-z0)=0

Collecting constants gives ax+by+cz=d with d=ax0+by0+cz0. So the normal can be read off the coefficients: 2x-y+3z=7 is perpendicular to ⟨2,-1,3⟩, and the floor z=0 has normal 𝐤. The angle between two planes is the angle between their normals. Given three points not on a line instead, the cross product of two edges supplies the normal, the construction tangent planes will use.

Example. A roof has its eaves along the line from (0,0,3) to (8,0,3) and rises to (0,4,6) at the ridge, in metres. Find its equation and its pitch, and the fraction of full sunlight a panel lying on it receives when the direction towards the sun is ⟨-2,-1,4⟩.

The edges from the first point are ⟨8,0,0⟩ and ⟨0,4,3⟩, with cross product ⟨0×3-0×4,0×0-8×3,8×4-0×0⟩=⟨0,-24,32⟩, or ⟨0,-3,4⟩ after dividing by 8, of length 5. The plane is -3y+4z=d, and (0,0,3) gives d=12; the ridge checks, since -12+24=12. The pitch is the angle between this normal and 𝐤: cosθ=4/5, so θ=36.87 degrees. A panel collects sunlight in proportion to the cosine of the angle between its normal and the sun's direction, here (0+3+16)/(521)=0.829, so 83 percent of what it would facing the sun squarely.

Now you. Find the plane through (0,0,3), (6,2,3) and (1,-3,5), and its angle to the horizontal, to one decimal place.

Answer

The edges are ⟨6,2,0⟩ and ⟨1,-3,2⟩, with cross product ⟨4,-12,-20⟩, or ⟨-1,3,5⟩ after dividing by -4. The first point gives d=15, so the plane is -x+3y+5z=15, and the other two points check. Then cosθ=5/35=0.845 and the angle is 32.3 degrees.

The distance from a point Q=(x1,y1,z1) to a plane is a projection. The shortest route runs along the normal, so the distance is the component, along 𝐧, of the displacement from any point of the plane to Q, which works out as |ax1+by1+cz1-d|/|𝐧|. The origin is |0-12|/5=2.4 metres from the roof plane above.

Distance, and what comes next

The formula this lesson began with is the one the next lesson needs first. In the plane the distance from (x,y) to (a,b) is (x-a)2+(y-b)2, and "(x,y) is close to (a,b)" now means that number is small, whatever direction the approach comes from. Limits in several variables are defined that way, and the function xy/(x2+y2) from the previous lesson will show how badly such a limit can behave. The rest of the toolkit is booked: unit vectors name the direction of a directional derivative, the dot product turns a gradient into a slope, and a normal and a point give a tangent plane.

One limit should be stated plainly. Length, distance, the dot product and angles work in any number of dimensions, with extra terms in the same formulas. The cross product does not: in four dimensions the vectors perpendicular to two given ones form a whole plane, so there is no single answer to pick. That is why Linear Algebra, which works in every dimension, does without it, and why this course uses it only in the three dimensional space where graphs of two variable functions live.