Skip to main content

Dot and Cross Products

  • Situation: Alignment, projection and surface normals
  • Target: Dot product · Projection · Cross product
  • Convention: Right-handed orthonormal frame; column vectors; rightmost matrix first; angles in radians unless marked °; lengths in m · Overview

Core concepts​

  • Dot product: scalar a·b=Σaibi=‖a‖‖b‖cosθ; positive/zero/negative for acute/perpendicular/obtuse nonzero vectors
dot product angle
Figure 1. dot product angle
dot product sign
Figure 2. dot product sign
  • Projection: onto nonzero b, (a·b)/(b·b) times b; residual perpendicular to b; unit-axis scalar projection a·b̂

  • Cross product: perpendicular vector in a right-handed frame; x×y=z, swapped order reversing sign

cross product perpendicular
Figure 3. cross product perpendicular
cross product handedness
Figure 4. cross product handedness
cross product order
Figure 5. cross product order
  • Area: cross magnitude as parallelogram area, half as triangle area; collinear edges giving zero normal

  • Angle: nonzero inputs required; rounded cosine clamped to [−1,1] before arccos; displacement products in m²

Worked example​

Shared edges: d=B−A=(3,4,0), e=C−A=(0,4,0) m; d·e=16 m², d×e=(0,0,12) m²; angle≈36.87°, triangle area6 m²

a×b=[aybz−azbyazbx−axbzaxby−aybx],proj⁡ba=a⋅bb⋅bb\mathbf a\times\mathbf b= \begin{bmatrix}a_yb_z-a_zb_y\\a_zb_x-a_xb_z\\a_xb_y-a_yb_x\end{bmatrix}, \qquad \operatorname{proj}_{\mathbf b}\mathbf a=\frac{\mathbf a\cdot\mathbf b}{\mathbf b\cdot\mathbf b}\mathbf b

Practice​

  • Preparation → prediction → calculation: Reuse d,e and unit directions; predict signs under reversal; calculate dot, cross, angle and projection; retain unit normal (0,0,1) for the plane
  • Record: Assumed exercise inputs; predictions before calculation; calculated answers and optional viewer output in separate columns; no physical measurements
CasePredictionCalculated resultViewer output (optional)
e×d\mathbf e\times\mathbf d
proj⁡ed\operatorname{proj}_{\mathbf e}\mathbf d
d−proj⁡ed\mathbf d-\operatorname{proj}_{\mathbf e}\mathbf d
  • Optional extension: Field-of-view test using unit forward f and unit target direction u: f·u≥cosα for half-angle α

Exercises​

  1. Problem: e×d\mathbf e\times\mathbf d
  2. Problem: proj⁡ed\operatorname{proj}_{\mathbf e}\mathbf d
  3. Problem: d−proj⁡ed\mathbf d-\operatorname{proj}_{\mathbf e}\mathbf d
  4. Problem: Cross-product normalization for parallel nonzero vectors
Answers and checks
  1. Answer: (0,0,−12) m2(0,0,-12)\ \mathrm{m^2}
  2. Answer: (0,4,0) m(0,4,0)\ \mathrm m
  3. Answer: (3,0,0) m(3,0,0)\ \mathrm m
  4. Answer: Undefined; cross product zero

Connections​