Geometry is the branch of mathematics concerned with the properties and relations of points, lines, surfaces, and solids.
This chapter surveys the major areas of classical and coordinate geometry, with key formulas and Python examples.
1. Plane Geometry ¶ 1.1 Angles and Lines ¶ Two lines are parallel if they never intersect and perpendicular if they intersect at a right angle (90 ° 90° 90° ).
Angles are measured in degrees or radians:
θ rad = π 180 θ deg \theta_{\text{rad}} = \frac{\pi}{180} \theta_{\text{deg}} θ rad = 180 π θ deg Complementary angles sum to 90 ° 90° 90° ; supplementary angles sum to 180 ° 180° 180° .
1.2 Triangles ¶ For any triangle with sides a a a , b b b , c c c and angles A A A , B B B , C C C opposite to those sides:
Angle sum : A + B + C = 180 ° A + B + C = 180° A + B + C = 180°
Area : S = 1 2 a b sin C \displaystyle S = \frac{1}{2}ab\sin C S = 2 1 ab sin C
Perimeter : p = a + b + c p = a + b + c p = a + b + c
Heron’s formula : S = s ( s − a ) ( s − b ) ( s − c ) \displaystyle S = \sqrt{s(s-a)(s-b)(s-c)} S = s ( s − a ) ( s − b ) ( s − c ) , where s = p / 2 s = p/2 s = p /2
Pythagorean theorem (right triangle, C = 90 ° C = 90° C = 90° ):
a 2 + b 2 = c 2 a^2 + b^2 = c^2 a 2 + b 2 = c 2 Law of cosines (general triangle):
c 2 = a 2 + b 2 − 2 a b cos C c^2 = a^2 + b^2 - 2ab\cos C c 2 = a 2 + b 2 − 2 ab cos C Law of sines :
a sin A = b sin B = c sin C = 2 R \frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C} = 2R sin A a = sin B b = sin C c = 2 R where R R R is the circumradius of the triangle.
1.3 Circles ¶ For a circle of radius r r r :
Property Formula Circumference C = 2 π r C = 2\pi r C = 2 π r Area A = π r 2 A = \pi r^2 A = π r 2 Arc length (central angle θ \theta θ ) s = r θ s = r\theta s = r θ Sector area A sector = 1 2 r 2 θ A_{\text{sector}} = \frac{1}{2}r^2\theta A sector = 2 1 r 2 θ
1.4 Common Polygons ¶ For a regular n n n -gon with side length s s s :
Interior angle = ( n − 2 ) ⋅ 180 ° n Area = n s 2 4 cot ( π n ) \begin{align}
\text{Interior angle} &= \frac{(n-2)\cdot 180°}{n} \\
\text{Area} &= \frac{ns^2}{4}\cot\!\left(\frac{\pi}{n}\right)
\end{align} Interior angle Area = n ( n − 2 ) ⋅ 180° = 4 n s 2 cot ( n π ) 2. Coordinate Geometry ¶ In the Cartesian plane, every point is given by ( x , y ) (x, y) ( x , y ) .
2.1 Distance and Midpoint ¶ The distance between P 1 = ( x 1 , y 1 ) P_1 = (x_1, y_1) P 1 = ( x 1 , y 1 ) and P 2 = ( x 2 , y 2 ) P_2 = (x_2, y_2) P 2 = ( x 2 , y 2 ) :
d = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} d = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 The midpoint M M M :
M = ( x 1 + x 2 2 , y 1 + y 2 2 ) M = \left(\frac{x_1 + x_2}{2},\; \frac{y_1 + y_2}{2}\right) M = ( 2 x 1 + x 2 , 2 y 1 + y 2 ) 2.2 Lines ¶ The equation of a line through ( x 1 , y 1 ) (x_1, y_1) ( x 1 , y 1 ) with slope m = Δ y Δ x m = \dfrac{\Delta y}{\Delta x} m = Δ x Δ y :
y − y 1 = m ( x − x 1 ) (point-slope form) y - y_1 = m(x - x_1) \quad \text{(point-slope form)} y − y 1 = m ( x − x 1 ) (point-slope form) Standard form: a x + b y + c = 0 ax + by + c = 0 a x + b y + c = 0 . The distance from a point ( x 0 , y 0 ) (x_0, y_0) ( x 0 , y 0 ) to this line:
d = ∣ a x 0 + b y 0 + c ∣ a 2 + b 2 d = \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}} d = a 2 + b 2 ∣ a x 0 + b y 0 + c ∣ 2.3 Conic Sections ¶ Conic sections arise as the intersection of a plane with a double cone.
Conic Standard Equation Circle x 2 + y 2 = r 2 x^2 + y^2 = r^2 x 2 + y 2 = r 2 Ellipse x 2 a 2 + y 2 b 2 = 1 \dfrac{x^2}{a^2} + \dfrac{y^2}{b^2} = 1 a 2 x 2 + b 2 y 2 = 1 Parabola y = a x 2 + b x + c y = ax^2 + bx + c y = a x 2 + b x + c Hyperbola x 2 a 2 − y 2 b 2 = 1 \dfrac{x^2}{a^2} - \dfrac{y^2}{b^2} = 1 a 2 x 2 − b 2 y 2 = 1
For an ellipse, the eccentricity e = c / a e = c/a e = c / a where c 2 = a 2 − b 2 c^2 = a^2 - b^2 c 2 = a 2 − b 2 (a > b a > b a > b ). When e = 0 e = 0 e = 0 it is a circle; as e → 1 e \to 1 e → 1 it becomes a parabola.
A geometric transformation maps points in the plane to new positions.
3.1 Translation ¶ Shift every point by ( Δ x , Δ y ) (\Delta x, \Delta y) ( Δ x , Δ y ) :
( x ′ y ′ ) = ( x y ) + ( Δ x Δ y ) \begin{pmatrix} x' \\ y' \end{pmatrix}
= \begin{pmatrix} x \\ y \end{pmatrix}
+ \begin{pmatrix} \Delta x \\ \Delta y \end{pmatrix} ( x ′ y ′ ) = ( x y ) + ( Δ x Δ y ) 3.2 Rotation ¶ Rotate by angle θ \theta θ about the origin:
( x ′ y ′ ) = ( cos θ − sin θ sin θ cos θ ) ( x y ) \begin{pmatrix} x' \\ y' \end{pmatrix}
= \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}
\begin{pmatrix} x \\ y \end{pmatrix} ( x ′ y ′ ) = ( cos θ sin θ − sin θ cos θ ) ( x y ) 3.3 Reflection ¶ Reflection across the x x x -axis: ( x , y ) ↦ ( x , − y ) (x, y) \mapsto (x, -y) ( x , y ) ↦ ( x , − y ) .
Reflection across the line y = x y = x y = x : ( x , y ) ↦ ( y , x ) (x, y) \mapsto (y, x) ( x , y ) ↦ ( y , x ) .
3.4 Scaling (Dilation) ¶ Scale by factor k k k from the origin:
( x , y ) ↦ ( k x , k y ) (x, y) \mapsto (kx,\; ky) ( x , y ) ↦ ( k x , k y ) 4. Solid Geometry ¶ 4.1 Common 3-D Volumes and Surface Areas ¶ Solid Volume Surface Area Cube (side a a a ) a 3 a^3 a 3 6 a 2 6a^2 6 a 2 Rectangular box ℓ w h \ell w h ℓ w h 2 ( ℓ w + ℓ h + w h ) 2(\ell w + \ell h + wh) 2 ( ℓ w + ℓ h + w h ) Sphere (radius r r r ) 4 3 π r 3 \dfrac{4}{3}\pi r^3 3 4 π r 3 4 π r 2 4\pi r^2 4 π r 2 Cylinder (r r r , h h h ) π r 2 h \pi r^2 h π r 2 h 2 π r ( r + h ) 2\pi r(r + h) 2 π r ( r + h ) Cone (r r r , h h h ) 1 3 π r 2 h \dfrac{1}{3}\pi r^2 h 3 1 π r 2 h π r ( r + l ) \pi r(r + l) π r ( r + l ) , l = r 2 + h 2 l = \sqrt{r^2 + h^2} l = r 2 + h 2 Tetrahedron (side a a a ) a 3 6 2 \dfrac{a^3}{6\sqrt{2}} 6 2 a 3 a 2 3 a^2\sqrt{3} a 2 3
4.2 Coordinates in 3-D ¶ Cartesian : ( x , y , z ) (x, y, z) ( x , y , z ) . Euclidean distance:
d = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 + ( z 2 − z 1 ) 2 d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2 + (z_2-z_1)^2} d = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 + ( z 2 − z 1 ) 2 Spherical ( r , θ , ϕ ) (r, \theta, \phi) ( r , θ , ϕ ) :
x = r sin ϕ cos θ y = r sin ϕ sin θ z = r cos ϕ \begin{align}
x &= r\sin\phi\cos\theta \\
y &= r\sin\phi\sin\theta \\
z &= r\cos\phi
\end{align} x y z = r sin ϕ cos θ = r sin ϕ sin θ = r cos ϕ Cylindrical ( ρ , θ , z ) (\rho, \theta, z) ( ρ , θ , z ) :
x = ρ cos θ y = ρ sin θ z = z \begin{align}
x &= \rho\cos\theta \\
y &= \rho\sin\theta \\
z &= z
\end{align} x y z = ρ cos θ = ρ sin θ = z 5. Trigonometry ¶ 5.1 Right-Triangle Definitions ¶ For angle θ \theta θ in a right triangle (opposite o o o , adjacent a a a , hypotenuse h h h ):
sin θ = o h , cos θ = a h , tan θ = o a \sin\theta = \frac{o}{h}, \quad
\cos\theta = \frac{a}{h}, \quad
\tan\theta = \frac{o}{a} sin θ = h o , cos θ = h a , tan θ = a o 5.2 Key Identities ¶ sin 2 θ + cos 2 θ = 1 sin ( α ± β ) = sin α cos β ± cos α sin β cos ( α ± β ) = cos α cos β ∓ sin α sin β tan ( α + β ) = tan α + tan β 1 − tan α tan β \begin{align}
\sin^2\theta + \cos^2\theta &= 1 \\
\sin(\alpha \pm \beta) &= \sin\alpha\cos\beta \pm \cos\alpha\sin\beta \\
\cos(\alpha \pm \beta) &= \cos\alpha\cos\beta \mp \sin\alpha\sin\beta \\
\tan(\alpha + \beta) &= \frac{\tan\alpha + \tan\beta}{1 - \tan\alpha\tan\beta}
\end{align} sin 2 θ + cos 2 θ sin ( α ± β ) cos ( α ± β ) tan ( α + β ) = 1 = sin α cos β ± cos α sin β = cos α cos β ∓ sin α sin β = 1 − tan α tan β tan α + tan β Double-angle formulas :
sin 2 θ = 2 sin θ cos θ cos 2 θ = cos 2 θ − sin 2 θ = 1 − 2 sin 2 θ \begin{align}
\sin 2\theta &= 2\sin\theta\cos\theta \\
\cos 2\theta &= \cos^2\theta - \sin^2\theta = 1 - 2\sin^2\theta
\end{align} sin 2 θ cos 2 θ = 2 sin θ cos θ = cos 2 θ − sin 2 θ = 1 − 2 sin 2 θ 5.3 Inverse Trig Functions ¶ Function Range arcsin x \arcsin x arcsin x [ − π / 2 , π / 2 ] [-\pi/2,\; \pi/2] [ − π /2 , π /2 ] arccos x \arccos x arccos x [ 0 , π ] [0,\; \pi] [ 0 , π ] arctan x \arctan x arctan x ( − π / 2 , π / 2 ) (-\pi/2,\; \pi/2) ( − π /2 , π /2 )
6. Geometric Inequalities ¶ Triangle inequality : ∣ a − b ∣ < c < a + b |a - b| < c < a + b ∣ a − b ∣ < c < a + b
AM–GM inequality : a + b 2 ≥ a b \dfrac{a+b}{2} \geq \sqrt{ab} 2 a + b ≥ ab for a , b ≥ 0 a, b \geq 0 a , b ≥ 0
Isoperimetric inequality : Among all plane figures with perimeter L L L , the circle has the maximum area A = L 2 / ( 4 π ) A = L^2 / (4\pi) A = L 2 / ( 4 π ) .
7. Vectors in Geometry ¶ Vectors provide a powerful algebraic framework for solving geometric problems.
7.1 Position Vectors and Geometric Proofs ¶ A point P P P with position vector p \mathbf{p} p relative to the origin. Key constructions:
Midpoint of A B AB A B : m = a + b 2 \mathbf{m} = \dfrac{\mathbf{a} + \mathbf{b}}{2} m = 2 a + b
Point dividing A B AB A B in ratio m : n m:n m : n : p = n a + m b m + n \mathbf{p} = \dfrac{n\,\mathbf{a} + m\,\mathbf{b}}{m + n} p = m + n n a + m b
Centroid of triangle A B C ABC A BC : g = a + b + c 3 \mathbf{g} = \dfrac{\mathbf{a} + \mathbf{b} + \mathbf{c}}{3} g = 3 a + b + c
7.2 Equations of Lines and Planes ¶ Line through point a \mathbf{a} a in direction d \mathbf{d} d :
r = a + t d , t ∈ R \mathbf{r} = \mathbf{a} + t\,\mathbf{d}, \quad t \in \mathbb{R} r = a + t d , t ∈ R Plane through point a \mathbf{a} a with normal n \mathbf{n} n :
n ⋅ ( r − a ) = 0 ⟺ n ⋅ r = n ⋅ a \mathbf{n} \cdot (\mathbf{r} - \mathbf{a}) = 0 \quad \Longleftrightarrow \quad \mathbf{n} \cdot \mathbf{r} = \mathbf{n} \cdot \mathbf{a} n ⋅ ( r − a ) = 0 ⟺ n ⋅ r = n ⋅ a Point to line : d = ∥ d × ( a − p ) ∥ ∥ d ∥ d = \dfrac{\|\mathbf{d} \times (\mathbf{a} - \mathbf{p})\|}{\|\mathbf{d}\|} d = ∥ d ∥ ∥ d × ( a − p ) ∥
Point to plane : d = ∣ n ⋅ ( p − a ) ∣ ∥ n ∥ d = \dfrac{|\mathbf{n} \cdot (\mathbf{p} - \mathbf{a})|}{\|\mathbf{n}\|} d = ∥ n ∥ ∣ n ⋅ ( p − a ) ∣
Angle between two planes : cos θ = ∣ n 1 ⋅ n 2 ∣ ∥ n 1 ∥ ∥ n 2 ∥ \cos\theta = \dfrac{|\mathbf{n}_1 \cdot \mathbf{n}_2|}{\|\mathbf{n}_1\|\,\|\mathbf{n}_2\|} cos θ = ∥ n 1 ∥ ∥ n 2 ∥ ∣ n 1 ⋅ n 2 ∣
7.4 Area and Volume via Cross and Scalar Triple Products ¶ Area of parallelogram spanned by u , v \mathbf{u}, \mathbf{v} u , v : A = ∥ u × v ∥ A = \|\mathbf{u} \times \mathbf{v}\| A = ∥ u × v ∥
Area of triangle : A = 1 2 ∥ u × v ∥ A = \frac{1}{2}\|\mathbf{u} \times \mathbf{v}\| A = 2 1 ∥ u × v ∥
Volume of parallelepiped spanned by u , v , w \mathbf{u}, \mathbf{v}, \mathbf{w} u , v , w : V = ∣ u ⋅ ( v × w ) ∣ V = |\mathbf{u} \cdot (\mathbf{v} \times \mathbf{w})| V = ∣ u ⋅ ( v × w ) ∣
Volume of tetrahedron : V = 1 6 ∣ u ⋅ ( v × w ) ∣ V = \frac{1}{6}|\mathbf{u} \cdot (\mathbf{v} \times \mathbf{w})| V = 6 1 ∣ u ⋅ ( v × w ) ∣
8. Curves and Parametric Equations ¶ 8.1 Parametric Curves ¶ A curve in the plane can be described by r ( t ) = ( x ( t ) , y ( t ) ) \mathbf{r}(t) = (x(t),\, y(t)) r ( t ) = ( x ( t ) , y ( t )) for t ∈ [ a , b ] t \in [a, b] t ∈ [ a , b ] .
Curve Parametrisation Circle (radius r r r ) x = r cos t , y = r sin t x = r\cos t,\; y = r\sin t x = r cos t , y = r sin t Ellipse (a , b a, b a , b ) x = a cos t , y = b sin t x = a\cos t,\; y = b\sin t x = a cos t , y = b sin t Cycloid x = r ( t − sin t ) , y = r ( 1 − cos t ) x = r(t - \sin t),\; y = r(1 - \cos t) x = r ( t − sin t ) , y = r ( 1 − cos t ) Lissajous x = A sin ( a t + δ ) , y = B sin ( b t ) x = A\sin(at + \delta),\; y = B\sin(bt) x = A sin ( a t + δ ) , y = B sin ( b t )
8.2 Arc Length ¶ For a smooth curve ( x ( t ) , y ( t ) ) (x(t), y(t)) ( x ( t ) , y ( t )) over [ a , b ] [a, b] [ a , b ] :
L = ∫ a b ( d x d t ) 2 + ( d y d t ) 2 d t L = \int_a^b \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2}\, dt L = ∫ a b ( d t d x ) 2 + ( d t d y ) 2 d t 8.3 Curvature ¶ The curvature κ \kappa κ measures how fast the curve bends:
κ = ∣ x ′ y ′ ′ − y ′ x ′ ′ ∣ ( x ′ 2 + y ′ 2 ) 3 / 2 \kappa = \frac{|x'y'' - y'x''|}{(x'^2 + y'^2)^{3/2}} κ = ( x ′2 + y ′2 ) 3/2 ∣ x ′ y ′′ − y ′ x ′′ ∣ For y = f ( x ) y = f(x) y = f ( x ) : κ = ∣ f ′ ′ ∣ ( 1 + f ′ 2 ) 3 / 2 \kappa = \dfrac{|f''|}{(1 + f'^2)^{3/2}} κ = ( 1 + f ′2 ) 3/2 ∣ f ′′ ∣ . The radius of curvature is R = 1 / κ R = 1/\kappa R = 1/ κ .
9. Non-Euclidean Geometry ¶ 9.1 Euclidean Parallel Postulate ¶ Euclid’s fifth postulate: through a point not on a given line, there is exactly one parallel line. Modifying this postulate yields non-Euclidean geometries.
9.2 Spherical (Elliptic) Geometry ¶ On the surface of a sphere of radius R R R :
Lines are great circles
No parallel lines exist (all great circles intersect)
Angle sum of a triangle: A + B + C = π + S R 2 A + B + C = \pi + \dfrac{S}{R^2} A + B + C = π + R 2 S where S S S is the area
Area of spherical triangle : S = R 2 ( A + B + C − π ) S = R^2(A + B + C - \pi) S = R 2 ( A + B + C − π ) (spherical excess)
9.3 Hyperbolic Geometry ¶ In the Poincaré half-plane model (upper half of R 2 \mathbb{R}^2 R 2 ):
Lines are vertical rays and semicircles orthogonal to the x x x -axis
Through a point not on a given line, there are infinitely many parallel lines
Angle sum of a triangle: A + B + C < π A + B + C < \pi A + B + C < π
Area of hyperbolic triangle : S = π − ( A + B + C ) S = \pi - (A + B + C) S = π − ( A + B + C ) (angular defect)
The metric is d s 2 = d x 2 + d y 2 y 2 ds^2 = \dfrac{dx^2 + dy^2}{y^2} d s 2 = y 2 d x 2 + d y 2 , giving constant negative curvature K = − 1 K = -1 K = − 1
9.4 Gaussian Curvature ¶ The Gaussian curvature K K K classifies surfaces locally:
K K K Geometry Model K = 0 K = 0 K = 0 Euclidean (flat) Plane, cylinder K > 0 K > 0 K > 0 Spherical (elliptic) Sphere K < 0 K < 0 K < 0 Hyperbolic (saddle) Pseudosphere
The Gauss–Bonnet theorem relates total curvature to topology:
∫ ∫ S K d A = 2 π χ ( S ) \int\!\!\int_S K\, dA = 2\pi\chi(S) ∫ ∫ S K d A = 2 π χ ( S ) where χ ( S ) \chi(S) χ ( S ) is the Euler characteristic of the surface (χ = 2 \chi = 2 χ = 2 for a sphere, χ = 0 \chi = 0 χ = 0 for a torus).
10. Compass and Straightedge Constructions ¶ Classical Greek geometry restricted constructions to an unmarked straightedge and a compass.
10.1 Constructible Operations ¶ Bisecting a segment or angle
Constructing a perpendicular to a line
Constructing a line parallel to a given line
Transferring a length
10.2 Impossible Constructions (proved in the 19th century) ¶ Three famous problems are impossible with compass and straightedge alone:
Problem Why impossible Squaring the circle Requires constructing π \sqrt{\pi} π ; π \pi π is transcendental Doubling the cube Requires constructing 2 3 \sqrt[3]{2} 3 2 ; not a constructible number Trisecting a general angle Leads to an irreducible cubic equation
A length is constructible if and only if it can be obtained from the rationals by a finite sequence of additions, subtractions, multiplications, divisions, and square roots — equivalently, the minimal polynomial has degree a power of 2.