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 π ) .
This is a placeholder for Geometry content.