Skip to content
Tutorials Center
My learning

Topics

Lesson 8 of 47 · Vectors and Forces

Vectors in three dimensions: unit vectors and forces along a line

Write forces in Cartesian form with i, j and k, find magnitudes and direction cosines, build position vectors and compute a force acting along a cable between two points.

Real structures are three-dimensional. A tripod, a crane with guy wires, a tower supported by cables from three sides: none of these fit on a flat page. Fortunately the component method extends neatly, and writing forces as Cartesian vectors turns three-dimensional geometry into plain arithmetic. This lesson shows how to describe a direction in 3D, build a vector from two points, and compute the force a cable exerts along its own line.

What you will learn

  • How to write a force as F = Fx i + Fy j + Fz k and find its magnitude.
  • What direction cosines are and why they satisfy cos²α + cos²β + cos²γ = 1.
  • How to form a position vector from two points and a unit vector from it.
  • How to compute the vector of a force that acts along a line in space.

Key terms

  • Unit vector: a vector of length 1 that only indicates direction. i, j, k point along +x, +y, +z.
  • Position vector r_AB: the vector from point A to point B.
  • Direction cosines: the cosines of the angles α, β, γ the vector makes with the +x, +y, +z axes.
  • Right-handed system: axes where, if you curl the fingers of your right hand from x to y, the thumb points along z.
A force vector F along the diagonal of a dashed box with components Fx i, Fy j and Fz k, and the formulas for magnitude and direction cosines
Caption: a 3D force is the diagonal of a box whose edges are its components. Its magnitude comes from the 3D Pythagorean theorem.

Cartesian vectors

Resolve a force along three perpendicular axes, set up as a right-handed system (x toward you, y to the right, z up is a common picture). Then

F = Fx i + Fy j + Fz k

and the magnitude comes from applying Pythagoras twice:

F = √(Fx² + Fy² + Fz²)

Adding vectors is simply adding coefficients: (Fx i + Fy j + Fz k) + (Gx i + Gy j + Gz k) = (Fx+Gx) i + (Fy+Gy) j + (Fz+Gz) k. So the resultant of any number of forces is R = ΣFx i + ΣFy j + ΣFz k, exactly the 2D recipe with one more line.

Direction cosines and unit vectors

Let α, β, γ be the angles between the force and the positive x, y and z axes. Then Fx = F cos α, Fy = F cos β, Fz = F cos γ. Dividing the vector by its magnitude gives the unit vector

u = F / F = cos α i + cos β j + cos γ k

Because |u| = 1, the direction cosines satisfy cos²α + cos²β + cos²γ = 1. Note what this implies: you cannot choose all three angles freely. Two determine the third, up to a sign.

Position vectors and forces along a line

A position vector points from one point to another. If point A is (xA, yA, zA) and B is (xB, yB, zB), then

r_AB = (xB − xA) i + (yB − yA) j + (zB − zA) k

You always subtract tail from tip: B minus A for the vector from A to B. Its length is the distance between the points.

Here is the most useful 3D technique in statics. A cable, strut or rod carries a force of known magnitude F along its own line. To get the force vector:

  1. Write the position vector along the line, in the direction the force acts.
  2. Divide by its length to make the unit vector u.
  3. Multiply: F_vector = F u.

Worked example. A cable pulls with tension 650 N from point A at the origin toward B at (3, 4, 12) m.

  • r = 3 i + 4 j + 12 k, with |r| = √(9 + 16 + 144) = 13 m.
  • u = (3 i + 4 j + 12 k) / 13.
  • F = 650 u = 150 i + 200 j + 600 k N.
  • Direction cosines: cos α = 3/13, cos β = 4/13, cos γ = 12/13, so α = 76.7°, β = 72.1°, γ = 22.6°.

The numbers (3, 4, 12, 13) were chosen so the length is whole, but real problems rarely cooperate. The method works regardless.

Python Force along a line, step by step

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Direction cosines also double as a check on your work: if u·u is not 1, something is wrong.

Seeing it in 3D

The plot below draws the cable force and its three components so that you can rotate the intuition: the vector is the box diagonal.

Python The force and its box of components

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Finally, try your own components and watch the magnitude and the direction angles.

Magnitude and direction angles from components

Common misconceptions

"The direction angles can be any three angles." They are tied together by cos²α + cos²β + cos²γ = 1.

"r_AB = A − B." The vector from A to B is B minus A. Reversing it reverses the force direction.

"The force on the rod points the same way for the rod and for the point it pulls." By Newton's third law, a cable pulling on a point toward B means the point pulls on the cable the other way. Decide which body's FBD you are drawing.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the magnitude of F = 2 i − 3 j + 6 k (N)?

    √(4 + 9 + 36) = √49 = 7 N.
  2. 2. Point A is (1, 2, 3) m and B is (4, 6, 15) m. What is r_AB?

    Subtract tail from tip: (4−1, 6−2, 15−3) = (3, 4, 12).
  3. 3. A force makes angles of 60° and 45° with the +x and +y axes. What are the possible angles with +z?

    cos²60° + cos²45° = 0.25 + 0.5 = 0.75, so cos²γ = 0.25 and cos γ = ±0.5, giving 60° or 120°.
  4. 4. A 130 N force acts along r = 3 i + 4 j + 12 k (|r| = 13 m). What is Fz?

    Fz = 130 × 12/13 = 120 N.

Summary

  • A 3D force is F = Fx i + Fy j + Fz k with F = √(Fx² + Fy² + Fz²).
  • Direction cosines are Fx/F, Fy/F, Fz/F and satisfy cos²α + cos²β + cos²γ = 1.
  • r_AB = B − A; the unit vector is u = r / |r|; a force along the line is F u.
  • Add vectors component by component.

Next: Dot and cross products