Vectors: arrows with length and direction
The question. How do you tell a computer where your elbow is, which way a muscle pulls on it, and how hard?
A simulator works with numbers only, so every place and every pull must be written as numbers. One kind of object does both jobs: an arrow with a length and a direction. Every place, every speed with its direction, and every push or pull in this book is such an arrow. Two ways of multiplying arrows then answer the questions a body simulator asks most often: how much of this pull acts along that bone, and how strongly does this pull turn it?
By the end you will be able to add arrows, measure them, find the part of one arrow that lies along another, and build the arrow at right angles to two others.
Where things are
Positions are measured from a fixed point, the origin, along three fixed directions at right angles to one another, the axes , and . Together they make a coordinate frame. This book uses one frame throughout, the world frame: points up, and are level, and distances are in metres (m).
A position is the place of a point, written as three numbers: how far to go from the origin along , then along , then along . Put the origin at a person’s shoulder and let them face along . An elbow 0.1 m in front of the shoulder and 0.3 m below it is at m.
A vector is an arrow: a length together with a direction. We write it in bold and describe it by its three components, the distances it reaches along , and :
A displacement is the vector from one point to another. The upper arm, from shoulder to elbow, is the displacement m. A position is the displacement from the origin. A plain number with no direction, such as a length or a temperature, is called a scalar.
Adding and scaling
Follow one arrow, then a second that starts where the first ended. The single arrow from start to finish is their sum:
In words: add component by component, because the distance covered along each axis is what the first arrow covers plus what the second covers.
Hold the forearm level, pointing forward. From elbow to wrist it is m, so the wrist is at
from the shoulder.
Multiplying a vector by a number multiplies every component: . The arrow keeps its direction and becomes times as long; a negative turns it to point the opposite way. Subtracting means adding the reversed arrow, .
Length and direction
The length of a vector, written , comes from Pythagoras’ theorem. On flat paper, an arrow reaching across and up is the long side of a right-angled triangle, so its length is . In space, that flat arrow and the reach form a second right-angled triangle. Applying the theorem again gives
In words: square the components, add them, and take the square root. The wrist is m from the shoulder.
A unit vector is a vector of length 1. Dividing any vector by its own length gives the unit vector that points the same way, written with a hat: . It keeps the direction and discards the length. From shoulder to wrist the direction is , and indeed .
Every vector is therefore a length multiplied by a unit vector: how much, times which way.
Try it: adding arrows
- Check the worked example. Leave the controls alone. The sum reads (0.4, −0.3, 0) m, its length 0.5 m and its direction (0.8, −0.6, 0). Press Play: the marker follows , then , and arrives at the tip of .
- Predict, then check. Point the forearm straight up: set to (0, 0.3, 0). Where is the wrist now, and how far from the shoulder? It is at (0.1, 0, 0) m, only 0.1 m away.
- Leave the flat page. Set to (0.3, 0, 0.3). Predict the length of the sum before you look: m. Drag the picture to turn it and see the arrow leave the plane of the other two.
- Swap the arrows. Set to (0.3, 0, 0) and to (0.1, −0.3, 0). The marker takes a different route to the same place. Adding arrows gives the same sum in either order.
How much of one arrow lies along another
A pull has a strength and a direction, so it is a vector too. Its strength is measured in newtons (N), a unit that the next part introduces. When a muscle pulls on the forearm, part of the pull runs along the bone and presses it into the elbow. Only the rest, running across the bone, turns it. How much runs along?
The dot product of two vectors is the number
In words: multiply matching components and add. Two facts make it useful.
It measures length. The dot product of a vector with itself is , the square of its length: .
It detects right angles. Draw and from one point. The arrow joins their tips and closes a triangle. Multiplying out its squared length one component at a time, and so on, gives
By Pythagoras’ theorem the corner between and is a right angle exactly when , and by the line above that means . Two vectors are perpendicular, at right angles, exactly when their dot product is zero.
Now take a unit vector along the bone, and from the tip of drop a line that meets the line of at a right angle. It lands a distance along it. That distance is the projection of on : the shadow casts along the bone. The dropped line is the arrow , and it is perpendicular to , so their dot product is zero. Multiplied out component by component, that reads
In words: the dot product with a unit vector is the part of the arrow that lies along it, .
The arrow, its shadow and the dropped line form a right-angled triangle. If is the angle between and , the shadow is the side next to that angle, and the cosine is by definition the ratio of that side to the long side: . Writing gives the general rule
In words: the dot product is the two lengths multiplied together, reduced according to how far apart the arrows point. It is largest when they point the same way, zero when they are perpendicular, and negative when they are more than 90° apart, because the shadow then falls behind the starting point. These results are theorem 10.3.7 and the orthogonal projection of Hartman 2017, section 10.3.
Worked example. A pull N acts on a bone that lies along .
| Quantity | Calculation | Result |
|---|---|---|
| Dot product | 12 | |
| Length of | 5 N | |
| Length of | 4 | |
| Part of along | 3 N | |
| Cosine of the angle | 0.6, so the angle is 53.13° |
Of the 5 N pull, 3 N runs along the bone.
Try it: the part of a pull along a bone
- Check the worked example. The dot product reads 12, the angle 53.13° and the part of along 3 N. On the ruler beside , the shadow of ends at the 3 N mark.
- Predict, then check. Tilt the bone to . The dot product becomes and the length of is 5, so 4.8 N of the pull now runs along the bone.
- Shorten the bone arrow. Set , the same direction at half the length. The dot product halves to 12, but the part of along stays 4.8 N. Only the direction of decides it.
- Find a right angle. Before trying it, work out for . It is : the arrows are perpendicular and none of the pull runs along the bone.
- Turn the bone all the way round. Press Play. The plot traces a cosine curve: zero at 90° and at 270°, and most negative at 180°, where the pull points straight against .
The arrow at right angles to two arrows
Hold your forearm level and hang a shopping bag from your hand. The bag pulls straight down and tries to turn the forearm about the elbow. How strongly it turns depends on the pull, on the distance from elbow to hand, and on the angle between them: the same pull directed along the forearm would not turn it at all.
The cross product packs all of this into one vector:
In words: each component is built from the other two axes, and the pattern repeats as . It has three properties.
- It is perpendicular to both arrows. Test it with the dot product: . The six terms cancel in pairs, leaving zero. The same happens with .
- The right-hand rule picks which way. Two directions are perpendicular to both arrows. Point the fingers of your right hand along and curl them toward : your thumb points along . Swapping the arrows reverses the result.
- Its length is , the area of the parallelogram, the slanted four-sided figure, with sides and . The sine is the ratio of the side opposite the angle to the long side of a right-angled triangle. It is 1 at a right angle and 0 when the arrows are parallel.
The rule and the length are given in Long and Keller 2026, section 9.5 and Hartman 2017, section 10.4. The world frame obeys the same rule: with and as the two arrows, the thumb points along . Such a frame is right-handed.
Worked example. From elbow to hand the forearm is m, and the bag pulls with N.
Its length is 6, which equals . Because it multiplies metres by newtons, its unit is the newton-metre (N·m). It points along : with your fingers along and curling down toward , your thumb points away from you. That line is the hinge of the elbow, and the next part names this vector the torque of the pull.
Try it: the turning leverage of a pull
- Check the worked example. The cross product reads (0, 0, −6) N·m and its length 6 N·m. The shaded parallelogram is the one spanned by and .
- Predict, then check. Add a 10 N pull along the forearm by setting the component of to 10. The cross product does not change. Only the part of the pull that runs across the forearm turns it.
- Halve the lever. Put the component of back to 0 and set the component of to 0.15. Predict the length first: it halves to 3 N·m.
- Pull upward. Restore and set the component of to 20. The arrow flips to point along , toward you. Check it with your right hand.
- Pull sideways. Set . The cross product becomes (0, −6, 0): still perpendicular to both arrows. Confirm it by working out its dot product with each.
- Turn the pull all the way round. Press Play. The plotted length follows a sine curve: greatest at 90°, zero at 180° where the pull lines up with the forearm, and reversed beyond that.
What this model leaves out
- Where an arrow is attached. The same pull applied at the hand and at the elbow is the same vector, with different effects. Torque accounts for the point of application.
- Turning and stretching whole shapes. One arrow describes one point. Moving every point of a bone at once is the subject of the next chapter.
- Arrows that change. Positions and pulls change from moment to moment. Rates of change measures how fast.
Summary
- A vector is a length with a direction, written as three components. Positions, displacements and pulls are all vectors.
- Vectors add component by component. The length is , and dividing by it leaves a unit vector, the pure direction.
- The dot product is a number. With a unit vector it gives the part of one arrow along another, and it is zero for perpendicular arrows.
- The cross product is a vector perpendicular to both, pointing by the right-hand rule, with length . It measures turning leverage.
Next: a vector places one point, but a bone is made of many, so we need a rule that moves them all at once: matrices.