liveBook · Manning

Triple product

As explained in Geometry for Programmers

The triple product is the scalar obtained by taking the dot product of one vector with the cross product of two other vectors, equal to the signed volume of their parallelepiped.

The triple product combines three vectors into one scalar: d = a · (b × c). Geometrically, it is the signed volume of the parallelepiped spanned by a, b, and c. It is also called the box product. section 9.4 section 9.4.1

Compute the cross product first, then dot its vector result with the remaining vector. The equivalent form (a × b) · c gives the same result, but a dot product cannot come first because it produces a scalar rather than a vector. section 9.4 section 9.4.1

Operand order carries orientation information:

  • Cyclic rotations preserve the signed volume: (a × b) · c = (c × a) · b = (b × c) · a. section 9.4.4
  • Swapping any pair reverses the sign, representing the inverted orientation of the same-shaped parallelepiped. section 9.4.1 section 9.4.4
  • A determinant formed from the three vector coordinates provides an alternative way to calculate the same volume. section 9.4.1
Figure 9.19 The volume of the parallelepiped formed by (1, 0, 0), (0, 1, 0), and (0, 0, 1) is 1.
09-19

Three unit coordinate vectors form a parallelepiped with volume 1, making the scalar result visible as a concrete 3D volume. section 9.4.1

Distance from a point to a plane

Let p1, p2, and p3 define a plane, and let p be the query point. Form two base edges, p2 − p1 and p3 − p1, plus p − p1. Their triple product gives signed volume; divide its magnitude by the length of the base cross product to obtain the point-to-plane distance. Reusing that cross product makes the computation light. section 9.4.3

SymPy calculation

SymPy has no dedicated triple-product operation, but dot and cross compose directly: a.dot(b.cross(c)). With operator abbreviations, write a & (b ^ c); parentheses are required because Python evaluates & before ^. section 9.4.2

The same geometric idea extends beyond 3D: the resulting scalar represents signed N-dimensional volume of an N-dimensional parallelotope. In practice, 2D and 3D remain the usual working spaces, while determinants retain the generalized volume interpretation. section 9.5.1 section 9.8

How Geometry for Programmers covers it

How deep it goes
Explains formula, orientation-preserving permutations, determinant calculation, and a reusable volume-over-area distance computation.
Examples
Demonstrates unit coordinate vectors, a three-point plane and query point, and SymPy vectors producing −10.
What it assumes
Builds on dot and cross products, including cross-product area and vector output.
What you can do after
Apply it via SymPy or direct vector operations to compute signed volumes and point-to-plane distances.
How it connects
Connects dot products, cross products, determinants, signed area, plane normals, and point-to-plane distance.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.