Cross Ratio Calculator
The cross ratio is the fundamental invariant of projective geometry: a single number formed from four collinear points that does not change under any projective transformation. Enter the one-dimensional coordinates of four points A, B, C and D on a line, and this calculator returns the cross ratio (A,B;C,D) using the standard definition ((C - A)(D - B)) / ((C - B)(D - A)). It also reports the two product terms in the numerator and denominator, so you can see exactly how the value is built.
Cross ratio formula
(A,B;C,D) = ((C - A) * (D - B)) / ((C - B) * (D - A))
Numerator = (C - A) * (D - B)
Denominator = (C - B) * (D - A)
Harmonic range when value = -1
The four coordinates are positions along a line. The cross ratio combines two differences in the numerator and two in the denominator, and the result is invariant under projective maps.
About the cross ratio
- It is preserved by perspective projection, the basis of single-view metrology in computer vision.
- Four points have six possible cross ratios depending on the labelling order.
- A value of -1 marks a harmonic range, central to projective and conic constructions.
- The cross ratio of points on a conic seen from any point on the conic is constant.
- It extends to the projective line using the point at infinity for limiting cases.
Cross ratio: frequently asked questions
What is the cross ratio?
The cross ratio of four collinear points A, B, C, D is the projective invariant (A,B;C,D) = ((C - A)(D - B)) / ((C - B)(D - A)). It is preserved under any projective transformation, which is why it is fundamental in projective geometry.
Why is the cross ratio important?
It is the basic invariant of projective geometry. Lengths, ratios and even simple ratios change under perspective projection, but the cross ratio of four collinear points stays the same, making it central to computer vision, perspective drawing and projective proofs.
What order convention does this calculator use?
It uses (A,B;C,D) = ((C - A)(D - B)) / ((C - B)(D - A)) with the four coordinates entered as A, B, C, D. Different textbooks permute the labels, which changes the numerical value among the six possible cross ratios.
What value means the points are harmonic?
When the cross ratio equals -1, the four points form a harmonic range and are said to be harmonic conjugates. This special case appears throughout projective geometry and optics.
When is the cross ratio undefined?
It is undefined if the denominator is zero, which happens when C equals B or D equals A. The calculator shows n/a in that case. The four points should be distinct and collinear for a meaningful result.
Official sources
- NIST Digital Library of Mathematical Functions: DLMF home.
- NASA Technical Reports Server: Projective invariants and the cross ratio.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.