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 axis towards you, the axis to the right and the axis up, so that, as in the previous lesson, heights are measured along . A point is an ordered triple . The arrangement is right-handed: curl the fingers of the right hand from the positive axis to the positive axis and the thumb points along the positive axis. Distance does not care about this convention, but the cross product later on does.
Distance comes from Pythagoras applied twice. Between and , the horizontal distance across the floor is , and the vertical rise is perpendicular to it, so the two are the legs of a right triangle whose hypotenuse runs from to . Squaring and adding,
From to the differences are , and , and the distance is . The inside of a standard twenty foot shipping container measures by by metres, so the longest pipe that fits, corner to opposite corner, is metres.
The points at distance from a centre satisfy , the equation of a sphere. Faced with , complete the square in each variable to get : radius , centre .
Vectors and components
A point says where; a vector says how far and which way. The displacement from to is written , with angle brackets to keep it apart from a point, and the same vector carries to : a vector has length and direction but no fixed position. The vector from to is head minus tail, . Vectors are printed in bold, .
Addition and scaling are componentwise. is one displacement followed by the other, which is also how forces combine, and stretches the arrow by the factor , reversing it when . The length is the distance the arrow covers, , and dividing a non-zero vector by its length gives a unit vector in the same direction: . A unit vector is a pure direction, which is how later lessons will say "walk this way".
The unit vectors along the axes are , and , and every vector combines them: . 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:
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 . Compute the left side in components instead: each expands to , and the three together give . Comparing,
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: and are perpendicular because .
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 , , and . Find the angle between two carbon to hydrogen bonds.
Take and . The dot product is and each length is , so and degrees, the same for every pair by symmetry. Spectroscopy measures the H-C-H angle of methane as degrees.
Now you. Find the angle between the long diagonal of a unit cube and the diagonal of its floor, to two decimal places.
Answer
The dot product is and the lengths are and , so and 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, 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 kg box rests on a ramp rising metres for every of run, so the uphill direction is . Gravity is newtons, taking metres per second squared, and its component along the ramp is newtons, the pull needed to hold the box. The familiar 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 , since only the part of the force along the motion counts. For a kg walker, gravity is newtons, and over a route with displacement metres the work is , 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 perpendicular to both. That is two equations,
Multiply the first by and the second by and subtract: cancels, leaving , which and satisfy. Putting these into the first equation, two terms cancel and remains, and a direct check confirms that all three satisfy both equations. The result is the cross product:
The indices cycle : 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 ; for and the cross product has squared length , and . Writing the dot product as and using ,
which is base times height for the parallelogram with sides and . A triangle is half of one: the triangle with corners , and has edges and , whose cross product has length , so its area is .
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 mm long. With forward and up, the pedal is at metres from the axle, and the rider presses straight down with newtons. Find the torque.
As a check, . The components of are , then , then . The torque is , of newton metres along the axle. Only the crank's horizontal reach acts as lever arm against a vertical push, and agrees.
Now you. A spanner runs from the bolt to metres, and a hand pulls its end with newtons. Find the torque and its magnitude, to two decimal places.
Answer
The components are , then , then . So and newton metres, short of the a perpendicular pull would give.
Lines in space
In space a single equation in , and cuts out a surface, so a line needs another description: a motion. Start at and move in the direction ; after time the position is
These parametric equations trace the whole line as runs over the real numbers. The line through and is , , , at the first point when , the second when and the midpoint when . 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 metres tall stands at the origin and sunlight travels in the direction . The ray through the top is , which reaches the ground at , the point . The shadow is metres long, and the sun stands degrees above the horizon.
Two lines in the plane meet or are parallel; in space they can also be skew. The axis and the line have directions and , so they are not parallel, yet one lies at height and the other at height 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 on it and a normal vector perpendicular to it. A point lies in the plane exactly when its displacement from is perpendicular to , which by the dot product is
Collecting constants gives with . So the normal can be read off the coefficients: is perpendicular to , and the floor 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 to and rises to 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 .
The edges from the first point are and , with cross product , or after dividing by , of length . The plane is , and gives ; the ridge checks, since . The pitch is the angle between this normal and : , so degrees. A panel collects sunlight in proportion to the cosine of the angle between its normal and the sun's direction, here , so percent of what it would facing the sun squarely.
Now you. Find the plane through , and , and its angle to the horizontal, to one decimal place.
Answer
The edges are and , with cross product , or after dividing by . The first point gives , so the plane is , and the other two points check. Then and the angle is degrees.
The distance from a point 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 , which works out as . The origin is 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 to is , and " is close to " now means that number is small, whatever direction the approach comes from. Limits in several variables are defined that way, and the function 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.