Measuring what you cannot reach
How do you measure the height of a mountain you cannot climb, or the distance to a ship you cannot reach? In the 19th century the Great Trigonometrical Survey of India set out to map the subcontinent using nothing but carefully measured baselines and angles, observed with heavy theodolites from hilltops and towers. Among the "computers" who turned those observations into distances and heights was the Bengali mathematician Radhanath Sikdar. He is widely credited with the calculations, around 1852, showing that a distant Himalayan summit known as Peak XV was the highest mountain on Earth. In 1856 the Survey announced its height as feet. We now call it Everest, or Sagarmāthā in Nepali and Chomolungma in Tibetan.
The key fact is simple: in a right triangle, an angle determines the ratios of the sides. Measure one length and one angle, and trigonometry gives you the others. The same functions — sine and cosine — also describe anything that repeats: tides, sound waves, alternating current, the seasons. In this lesson we define them, prove the identities that connect them, and derive the two laws that solve any triangle.
Why a ratio can belong to an angle
Take any two right triangles that share an acute angle . Their third angles are both , so they are similar (AA; see rigid motions, congruence and similarity). One is a scaled copy of the other, so every ratio of sides is the same in both:
That ratio depends only on , so we can give it a name and tabulate it once and for all. This is exactly what astronomers in Greece, India and the Islamic world did, centuries before calculators: they made tables, and anyone could then convert angles into lengths.
Definitions
Definition— sine, cosine and tangent of an acute angle
In a right triangle with an acute angle , let the hypotenuse be the side opposite the right angle, the opposite side be the side facing , and the adjacent side be the other side touching . Then
Angles can be measured in degrees, but mathematics prefers a natural unit that comes from the circle itself.
Definition— radian
An angle of one radian at the centre of a circle cuts off an arc whose length equals the radius. In general, an angle of radians cuts off an arc of length on a circle of radius . A full turn is an arc of length , so
To convert degrees to radians, multiply by ; to convert back, multiply by . So , , and .
The triangle definition only works for angles between and . To go further, we use a circle.
Definition— sine and cosine of any angle (the unit circle)
The unit circle has centre and radius . Start at and turn through an angle about — anticlockwise if , clockwise if . The point you reach is, by definition,
Wherever , we define , the slope of the line from to that point.
For the two definitions agree: drop a perpendicular from the point to the -axis. You get a right triangle with hypotenuse , adjacent side and opposite side .
Because turning through brings you back to where you started, and are periodic with period (that is, ):
Reflecting in the -axis turns into , so (sine is odd) and (cosine is even). The tangent has period and is undefined where , at .
Worked examples
Example— Exact values from two special triangles
Cut a square of side along a diagonal: you get a right triangle with angles and sides . Cut an equilateral triangle of side in half: you get angles and sides (by Pythagoras, ). Reading off the ratios:
| undefined |
Example— Angles in every quadrant
The point at on the unit circle is the mirror image, in the -axis, of the point at . So and . In the same way, is the point at reflected through , so and . And because sine is odd.
In general : an angle and its supplement have the same sine. This will matter for the law of sines.
Example— The height of a tower you cannot reach
From a point on level ground, the top of a tower is seen at an angle of elevation of . After walking m straight towards the tower, to , the angle is . How tall is the tower?
Let the height be and the distance from to the foot of the tower be . From : , so . From : , so . Hence , and
Surveyors measuring a mountain do the same thing on a grander scale, with corrections for the curvature of the Earth and the bending of light in the air.
Example— Radians in action
A bicycle wheel of radius m turns through radians. A point on the rim travels m. In degrees the same angle is , and the formula would need an awkward factor: . Radians make arc length, and (in calculus) the derivatives of and , as simple as possible.
The identities and the laws
Theorem— Pythagorean identity
For every angle : .
Proof
The point is on the unit circle, so its distance from is . By the distance formula (which is the Pythagorean theorem; see the Pythagorean theorem), . The distance formula squares the coordinates, so their signs do not matter: the identity holds in every quadrant.
∎
Here means . Dividing the identity by gives wherever .
Theorem— Addition formulas
For all angles and :
Proof
Let be the rotation of the plane about through the angle . We use three geometric facts about rotations.
- Rotations add. Rotating by and then by is rotating by . In particular, rotations about commute.
- A quarter turn. Rotating the point by gives . (Rotate the right triangle with vertices , and by a quarter turn.)
- Rotations respect scaling and parallelograms. A rotation about is a rigid motion fixing , so it sends the point to and the parallelogram with vertices , , , to a parallelogram. Hence .
By the definition of sine and cosine, . By facts 1 and 2,
Now write and use fact 3:
But , so by fact 1 the left side is . Comparing coordinates gives both formulas.
∎
Theorem— Corollaries
- and .
- Double angles: and .
Proof
- Replace by and use , .
- Put , then use .
∎
For example, .
From now on, in a triangle we write , , for the sides, and , , also for the angles at those vertices.
Theorem— Law of cosines
In every triangle, .
Proof
Place at the origin and at on the positive -axis, with above the axis. The point is at distance from , in the direction at angle from the positive -axis, so by the unit-circle definition . This holds whether is acute, right or obtuse. By the distance formula,
∎
When , and the law of cosines is the Pythagorean theorem. When is obtuse, and : the side opposite an obtuse angle is longer than Pythagoras would give.
Theorem— Law of sines
In every triangle, .
Proof
In the coordinates of the last proof, the height of above the line is , so the area of the triangle is
The same argument at the other vertices gives . So . Dividing by gives , and taking reciprocals (the sines of the angles of a triangle are positive) gives the law.
∎
Note
The common ratio has a meaning: , where is the radius of the circumcircle. For acute , draw the diameter of the circumcircle. By the inscribed angle theorem , and by Thales' theorem the triangle has a right angle at ; so . (See Euclidean geometry and proof.)
Note
The ambiguous case returns. If you know , and and use the law of sines to find , you get . Since , there may be two possible angles — exactly the SSA ambiguity from Euclidean geometry. Always check whether also fits in the triangle.
Trigonometry in Lean
In Mathlib, Real.sin and Real.cos are not defined by triangles at all: they are defined by power series, through the complex exponential function, and they always take radians. So we begin with a conversion from degrees, which plays the role of a calculator's degree mode:
/-- Convert degrees to radians: `x°` is `x · π / 180` radians. Mathlib's `Real.sin` always
expects radians, exactly like a calculator in radian mode. -/
noncomputable def deg (x : ℝ) : ℝ := x * π / 180/-- `sin 30° = 1/2`. First `30° = π/6` radians (arithmetic), then Mathlib's exact value
`Real.sin_pi_div_six`. Note that `sin 30`, *without* the conversion, is the sine of 30 radians,
about `-0.988`. -/
theorem sin_deg_thirty : sin (deg 30) = 1 / 2 := by
have h : deg 30 = π / 6 := by unfold deg; ring
rw [h, sin_pi_div_six]The Pythagorean identity is in the library; the tangent version and an exact value are proved here from it:
/-- **The Pythagorean identity** `sin² θ + cos² θ = 1`: the point `(cos θ, sin θ)` lies on the
unit circle. Applies Mathlib's `Real.sin_sq_add_cos_sq`. -/
theorem sin_sq_add_cos_sq (θ : ℝ) : sin θ ^ 2 + cos θ ^ 2 = 1 := Real.sin_sq_add_cos_sq θ/-- `1 + tan² θ = 1 / cos² θ` whenever `cos θ ≠ 0`: divide the Pythagorean identity by
`cos² θ`. -/
theorem one_add_tan_sq (θ : ℝ) (h : cos θ ≠ 0) : 1 + tan θ ^ 2 = 1 / cos θ ^ 2 := by
rw [tan_eq_sin_div_cos, div_pow, eq_div_iff (pow_ne_zero 2 h), add_mul,
div_mul_cancel₀ _ (pow_ne_zero 2 h)]
linarith [Real.sin_sq_add_cos_sq θ]/-- `sin 60° = √3/2`, from `cos 60° = 1/2` (Mathlib's `Real.cos_pi_div_three`), the
Pythagorean identity (so `sin² 60° = 3/4`) and the fact that `sin 60° > 0`. -/
theorem sin_pi_div_three : sin (π / 3) = √3 / 2 := by
have hsq : sin (π / 3) ^ 2 = 3 / 4 := by
have := Real.sin_sq_add_cos_sq (π / 3)
rw [cos_pi_div_three] at this
linarith
have hpos : 0 < sin (π / 3) := by
apply sin_pos_of_pos_of_lt_pi <;> linarith [pi_pos]
have hroot : (√3 / 2) ^ 2 = 3 / 4 := by
rw [div_pow, sq_sqrt (by norm_num : (0 : ℝ) ≤ 3)]; norm_num
have hroot_pos : 0 < √3 / 2 := by positivity
nlinarith [sq_nonneg (sin (π / 3) - √3 / 2), sq_nonneg (sin (π / 3) + √3 / 2)]The addition formulas are proved by the rotation argument of the lesson, written with complex numbers. Multiplying by rotates the plane by (and is automatically "linear", which was fact 3). The rule is fact 1. Comparing imaginary and real parts gives the two formulas:
/-- **The addition formulas**
`sin (α + β) = sin α cos β + cos α sin β` and `cos (α + β) = cos α cos β − sin α sin β`.
This is the lesson's rotation proof in the language of complex numbers: multiplying by
`e^{iθ} = cos θ + i sin θ` rotates the plane by `θ`, and rotating by `β` and then by `α` is
rotating by `α + β`: `e^{i(α+β)} = e^{iα} e^{iβ}` (Mathlib's `Complex.exp_add`). Expanding the
product and comparing imaginary and real parts gives the two formulas. -/
theorem addition_formulas (α β : ℝ) :
sin (α + β) = sin α * cos β + cos α * sin β ∧
cos (α + β) = cos α * cos β - sin α * sin β := by
have key : Complex.exp (((α + β : ℝ) : ℂ) * Complex.I) =
Complex.exp ((α : ℂ) * Complex.I) * Complex.exp ((β : ℂ) * Complex.I) := by
rw [← Complex.exp_add]
congr 1
push_cast
ring
rw [Complex.exp_mul_I, Complex.exp_mul_I, Complex.exp_mul_I, ← Complex.ofReal_cos,
← Complex.ofReal_sin, ← Complex.ofReal_cos, ← Complex.ofReal_sin, ← Complex.ofReal_cos,
← Complex.ofReal_sin] at key
have him := congrArg Complex.im key
have hre := congrArg Complex.re key
simp only [Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im, Complex.ofReal_re,
Complex.ofReal_im, Complex.I_re, Complex.I_im] at him hre
constructor <;> linarithMathlib has the formula too. This version just applies it:
/-- The sine addition formula, straight from Mathlib (`Real.sin_add`). Compare
`addition_formulas`, which derives it from the exponential rule. -/
theorem sin_add_library (α β : ℝ) : sin (α + β) = sin α * cos β + cos α * sin β :=
Real.sin_add α β/-- **Sine does not distribute over addition.** "`sin (α + β) = sin α + sin β` for all `α, β`"
is false: with `α = β = π/2` the left side is `sin π = 0` and the right side is `1 + 1 = 2`. -/
theorem sin_add_ne_add : ¬ ∀ α β : ℝ, sin (α + β) = sin α + sin β := by
intro h
have h1 := h (π / 2) (π / 2)
rw [add_halves, sin_pi, sin_pi_div_two] at h1
norm_num at h1/-- **Double angle formulas** `sin 2θ = 2 sin θ cos θ` and `cos 2θ = 1 − 2 sin² θ`: put
`α = β = θ` in the addition formulas, then use `cos² θ = 1 − sin² θ`. -/
theorem double_angle (θ : ℝ) :
sin (2 * θ) = 2 * sin θ * cos θ ∧ cos (2 * θ) = 1 - 2 * sin θ ^ 2 := by
obtain ⟨hs, hc⟩ := addition_formulas θ θ
rw [two_mul, hs, hc]
constructor
· ring
· nlinarith [Real.sin_sq_add_cos_sq θ]Does this power-series sine agree with "opposite over hypotenuse"? Yes: Mathlib proves it for right triangles in any Euclidean space, with ∠ A B C the angle at B:
/-- **The power-series sine agrees with "opposite over hypotenuse".** In a right triangle with
the right angle at `B`, the sine of the angle at `C`, times the hypotenuse `AC`, is the side
`AB` opposite that angle. Applies Mathlib's
`EuclideanGeometry.sin_angle_mul_dist_of_angle_eq_pi_div_two`. -/
theorem sin_right_triangle {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V]
[MetricSpace P] [NormedAddTorsor V P] {A B C : P} (h : ∠ A B C = π / 2) :
sin (∠ B C A) * dist A C = dist A B :=
EuclideanGeometry.sin_angle_mul_dist_of_angle_eq_pi_div_two hThe coordinate computation in our proof of the law of cosines is an identity about real numbers. Mathlib also has the law of cosines and the law of sines for points of any Euclidean space:
/-- **The law of cosines, the coordinate computation.** Put the vertex `C` of the triangle at
the origin and `B = (a, 0)` on the positive x-axis. By the unit-circle definition of sine and
cosine, the vertex `A` at distance `b` from `C` and at angle `γ` is `A = (b cos γ, b sin γ)`.
By the distance formula, `c² = AB² = (b cos γ − a)² + (b sin γ)²`, and this simplifies to
`a² + b² − 2ab cos γ` using `sin² γ + cos² γ = 1`. -/
theorem law_of_cosines_coord (a b γ : ℝ) :
(b * cos γ - a) ^ 2 + (b * sin γ) ^ 2 = a ^ 2 + b ^ 2 - 2 * a * b * cos γ := by
have h := Real.sin_sq_add_cos_sq γ
calc (b * cos γ - a) ^ 2 + (b * sin γ) ^ 2
= b ^ 2 * (sin γ ^ 2 + cos γ ^ 2) + a ^ 2 - 2 * a * b * cos γ := by ring
_ = a ^ 2 + b ^ 2 - 2 * a * b * cos γ := by rw [h]; ring/-- **The law of cosines** for any three points of a Euclidean space (a plane, or space):
`AC² = AB² + CB² − 2 · AB · CB · cos ∠ABC`. Applies Mathlib's `EuclideanGeometry.law_cos`,
which is proved with vectors and the inner product. -/
theorem law_cos {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
[NormedAddTorsor V P] (A B C : P) :
dist A C * dist A C =
dist A B * dist A B + dist C B * dist C B - 2 * dist A B * dist C B * cos (∠ A B C) :=
EuclideanGeometry.law_cos A B C/-- **The law of sines** in the form `sin ∠ABC · BC = sin ∠CAB · CA`, that is,
`CA / sin B = BC / sin A` when the sines are non-zero. Applies Mathlib's
`EuclideanGeometry.law_sin`. -/
theorem law_sin {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P]
[NormedAddTorsor V P] (A B C : P) :
sin (∠ A B C) * dist B C = sin (∠ C A B) * dist C A :=
EuclideanGeometry.law_sin A B CWhat is not formalised here: the geometric facts about rotations used in our human proof of the addition formulas (the Lean proof uses complex multiplication instead), and the definition of radians by arc length (Mathlib measures angles through the inner product and arccos).
Checking identities, rebuilding an ancient table
"""Testing trigonometric identities: numbers, triangles and symbols.
Three kinds of evidence. (1) Numerical: evaluate both sides of an identity
at many seeded random angles and record the largest difference; a false
"identity" such as sin(a + b) = sin a + sin b is caught at once. (2) The laws
of cosines and sines, checked on random triangles built from coordinates.
(3) Symbolic: SymPy expands sin(a + b) and simplifies differences to 0. We
also show the classic trap of passing degrees to a function that expects
radians.
"""
import math
import random
import sympy
IDENTITIES = {
"sin^2 a + cos^2 a = 1":
lambda a, b: (math.sin(a) ** 2 + math.cos(a) ** 2, 1.0),
"sin(a+b) = sin a cos b + cos a sin b":
lambda a, b: (math.sin(a + b),
math.sin(a) * math.cos(b) + math.cos(a) * math.sin(b)),
"cos(a+b) = cos a cos b - sin a sin b":
lambda a, b: (math.cos(a + b),
math.cos(a) * math.cos(b) - math.sin(a) * math.sin(b)),
"cos 2a = 1 - 2 sin^2 a":
lambda a, b: (math.cos(2 * a), 1 - 2 * math.sin(a) ** 2),
"sin(a+b) = sin a + sin b (false!)":
lambda a, b: (math.sin(a + b), math.sin(a) + math.sin(b)),
}
def max_error(identity, pairs):
"""Largest |lhs - rhs| of an identity over a list of angle pairs."""
return max(abs(lhs - rhs) for lhs, rhs in (identity(a, b) for a, b in pairs))
def random_pairs(count, seed):
"""Seeded random angle pairs in [-2 pi, 2 pi]."""
rng = random.Random(seed)
return [(rng.uniform(-2 * math.pi, 2 * math.pi),
rng.uniform(-2 * math.pi, 2 * math.pi)) for _ in range(count)]
def triangle(p, q, r):
"""Side lengths (a, b, c) opposite p, q, r and the angles at p, q, r."""
a, b, c = math.dist(q, r), math.dist(r, p), math.dist(p, q)
def angle(u, v, w): # angle at v
x1, y1, x2, y2 = u[0] - v[0], u[1] - v[1], w[0] - v[0], w[1] - v[1]
return math.atan2(abs(x1 * y2 - y1 * x2), x1 * x2 + y1 * y2)
return (a, b, c), (angle(q, p, r), angle(p, q, r), angle(p, r, q))
def law_errors(sides, angles):
"""Relative errors of the law of cosines (at r) and the law of sines."""
(a, b, c), (pa, pb, pc) = sides, angles
cosines = abs(c * c - (a * a + b * b - 2 * a * b * math.cos(pc))) / (c * c)
ratios = [a / math.sin(pa), b / math.sin(pb), c / math.sin(pc)]
sines = (max(ratios) - min(ratios)) / max(ratios)
return cosines, sines
def symbolic_difference(lhs, rhs):
"""SymPy's simplification of lhs - rhs (0 means SymPy proves equality)."""
return sympy.simplify(sympy.expand_trig(lhs - rhs))
def main():
print(f"math.sin(30) = {math.sin(30):+.6f} (30 radians!)")
print(f"math.sin(math.radians(30)) = {math.sin(math.radians(30)):+.6f}")
pairs = random_pairs(1000, 2024)
print("Largest |lhs - rhs| over 1000 random angle pairs:")
for name, identity in IDENTITIES.items():
print(f" {name:<38} {max_error(identity, pairs):.1e}")
rng = random.Random(7)
worst_cos = worst_sin = 0.0
for _ in range(1000):
pts = [(rng.uniform(-5, 5), rng.uniform(-5, 5)) for _ in range(3)]
sides, angles = triangle(*pts)
if min(angles) < 1e-3: # skip nearly flat triangles
continue
e_cos, e_sin = law_errors(sides, angles)
worst_cos, worst_sin = max(worst_cos, e_cos), max(worst_sin, e_sin)
print("Random triangles, worst relative error:")
print(f" law of cosines {worst_cos:.1e}, law of sines {worst_sin:.1e}")
a, b = sympy.symbols("a b")
print("SymPy:")
print(f" expand_trig(sin(a+b)) = {sympy.expand_trig(sympy.sin(a + b))}")
for lhs, rhs in [(sympy.sin(a) ** 2 + sympy.cos(a) ** 2, 1),
(sympy.cos(2 * a), 1 - 2 * sympy.sin(a) ** 2),
(sympy.sin(a + b), sympy.sin(a) + sympy.sin(b))]:
print(f" simplify({lhs} - ({rhs})) = {symbolic_difference(lhs, rhs)}")
print()
print("Epistemic status: the numerical checks are evidence at finitely many")
print("points, accurate to rounding (1e-15 to 1e-13). One large error is")
print("enough to refute the false rule: that is a counterexample.")
print("SymPy's zeros are symbolic verifications that rely on its built-in")
print("rules. The proofs in the lesson explain why the identities hold.")
if __name__ == "__main__":
main()The true identities agree to about — that is floating-point rounding, not a failure. The false rule is off by more than : a single such case is a counterexample, which disproves it completely. Agreement at a thousand points, on the other hand, is only evidence; the proofs above are what make the identities certain.
Long before computers, astronomers built sine tables by hand. Around 499 CE the Indian mathematician Āryabhaṭa recorded a table of sines at steps of in his Āryabhaṭīya. Here we rebuild it using only the half-angle formula and the addition formulas:
"""Rebuild Aryabhata's sine table (499 CE) and compare it with modern values.
The Aryabhatiya lists 24 sine differences for steps of 3 3/4 degrees on a
circle of radius R = 3438 (about the number of arc-minutes in a radian), so
that R sin(3.75 n deg) is the sum of the first n differences. We rebuild the
table from scratch the way a table maker could: start from sin 30 = 1/2,
halve the angle three times with sin(x/2)^2 = (1 - cos x)/2, then step along
with the exact recurrence sin((n+1)h) = 2 cos h sin(nh) - sin((n-1)h).
"""
import math
#: The 24 sine differences of the Aryabhatiya (Gitikapada), radius 3438.
ARYABHATA_DIFFERENCES = [225, 224, 222, 219, 215, 210, 205, 199, 191, 183,
174, 164, 154, 143, 131, 119, 106, 93, 79, 65, 51,
37, 22, 7]
RADIUS = 3438
def half_angle(sin_x, cos_x):
"""Return (sin(x/2), cos(x/2)) for 0 <= x <= 180 degrees."""
return math.sqrt((1 - cos_x) / 2), math.sqrt((1 + cos_x) / 2)
def step_sine_and_cosine():
"""sin and cos of 3.75 deg, from sin 30 = 1/2 by three half-angle steps."""
s, c = 0.5, math.sqrt(3) / 2 # 30 degrees
for _ in range(3): # 15, 7.5, 3.75 degrees
s, c = half_angle(s, c)
return s, c
def sine_table(radius, steps):
"""[R sin(n h) for n = 0..steps] with h = 3.75 deg, by the recurrence."""
s1, c1 = step_sine_and_cosine()
table = [0.0, radius * s1]
for _ in range(steps - 1):
table.append(2 * c1 * table[-1] - table[-2])
return table
def cumulative(differences):
"""Running sums: the table entries encoded by a list of differences."""
out, total = [], 0
for d in differences:
total += d
out.append(total)
return out
def main():
rebuilt = sine_table(RADIUS, 24)
ancient = cumulative(ARYABHATA_DIFFERENCES)
print("R sin(3.75 n deg), R = 3438: rebuilt / Aryabhata / difference")
for n in range(1, 13):
left = f"{3.75 * n:6.2f} {rebuilt[n]:7.1f} {ancient[n - 1]:5d}"
left += f" {ancient[n - 1] - rebuilt[n]:+5.1f}"
m = n + 12
right = f"{3.75 * m:6.2f} {rebuilt[m]:7.1f} {ancient[m - 1]:5d}"
right += f" {ancient[m - 1] - rebuilt[m]:+5.1f}"
print(f"{left} |{right}")
worst = max(abs(a - r) for a, r in zip(ancient, rebuilt[1:]))
drift = max(abs(rebuilt[n] - RADIUS * math.sin(math.radians(3.75 * n)))
for n in range(25))
exact = sum(a == round(r) for a, r in zip(ancient, rebuilt[1:]))
print(f"Largest gap between Aryabhata's table and ours: {worst:.2f}")
print(f"Entries equal to our value rounded to a whole number: {exact}/24")
print(f"Largest gap between the recurrence and math.sin: {drift:.1e}")
print(f"R sin 90 deg should be R = {RADIUS}: rebuilt {rebuilt[24]:.4f}")
print()
print("Epistemic status: numerical. The recurrence and half-angle steps")
print("are exact identities; our only errors are floating-point rounding")
print("(shown above). Of Aryabhata's 24 whole-number entries, 19 are our")
print("values rounded and the other 5 are one unit away: errors below")
print("0.03% of R. How Aryabhata computed his table is a question for")
print("historians, which this program does not answer.")
if __name__ == "__main__":
main()The recurrence used, , follows from adding the formulas for and . Āryabhaṭa's whole-number values agree with ours to within one unit in .
Explore: the unit circle and the graphs
Move the slider (in radians). The point travels round the unit circle. The horizontal segment from shows and the vertical segment shows ; each counts as negative when it points left or down. Watch the signs change from quadrant to quadrant.
The unit circle definition
A point moves along the curve as t changes: x and y are both functions of t.
- unit circle
- radius at angle a
- cos a
- sin a
- (0.707, 0.707)
- (0.078, 0.098)
- (0.078, 0)
- (0.622, 0.098)
Unroll the circle: plotting the height against the angle gives the sine wave, and plotting gives the same wave shifted left by , because . The tangent shoots off to infinity wherever .
Graphs of sine, cosine and tangent
Move the sliders and trace along the curves to read off values.
- sin x
- cos x
- tan x
- sin x: y = 0.8415
- cos x: y = 0.5403
- tan x: y = 1.5574
Now change the amplitude , the frequency and the phase shift in . The period is . Every pure musical tone, and every simple oscillation, has a graph like this.
Amplitude, frequency and phase
Move the sliders and trace along the curves to read off values.
- y = A sin(k(x − c))
- y = sin x
- y = A sin(k(x − c)): y = 1.6829
- y = sin x: y = 0.8415
Finally, the addition formulas as geometry. The matrix of rotation by has columns and — the images of and in our proof. Below, is rotation by and is rotation by . The widget shows that the two orders give the same result, which turns the plane by . Multiplying the two matrices by hand gives exactly the addition formulas.
Rotations compose by adding angles
Apply A and then B, or B and then A, and compare the results.
- image of the grid
- image of the unit square
- image of the flag
- before the transformation
- after the first step
Here AB = BA: these two transformations commute.
BA means “apply A first, then B”: products of transformations are read from right to left.
det(AB) = det(BA) = det A · det B = 1 · 1 = 1 The area scale factor is the same in either order.
Exercises
1. Trigonometry
Warm-upHumanA ladder m long leans against a vertical wall. The angle between the ladder and the level ground has . How many metres is the foot of the ladder from the wall?
2. Trigonometry
Warm-upHumanConvert radians to degrees.
3. Trigonometry
CoreHumanWhat is ?
4. Trigonometry
CoreHumanWhich expression equals ?
5. Trigonometry
CoreHumanIn triangle , , and the angle between them is . Find .
6. Trigonometry
CoreHumanOur proof of the law of cosines puts at the origin, and . Why does the proof also work when the angle is obtuse?
7. Trigonometry
CoreHumanHow many angles with satisfy ?
8. Trigonometry
StretchHumanCompute exactly. (Hint below if you need it.)
9. Trigonometry
StretchFormalWhich Lean statement says correctly that is not an identity?
10. Trigonometry
StretchComputationalWrite third_side(a, b, angle_c_degrees) that returns the side of a triangle with sides , and the angle between them given in degrees, using the law of cosines. Remember that math.cos expects radians.
Common misconceptions
Misconception
Reading as " times ". is the name of a function, like in . You cannot "cancel" it: is not (it is ), and is not .
Misconception
Using degrees where radians are required (or the reverse). in radians, but . Calculators and programming languages have a mode or expect radians: Python's math.sin(30) means 30 radians. Formulas such as (and the derivative of being ) are true only in radians.
Misconception
"." Sine is not additive. With : , but . The correct rule is the addition formula, . A quick test: , which no sine can be.
Misconception
" means ." By convention , but means the inverse function , the angle in whose sine is . The reciprocal is written (cosecant). The notation is inconsistent; that is why many authors prefer .
Misconception
" has one solution in a triangle." Both and have the same sine. When the law of sines gives an angle, check whether the supplementary angle also works — the SSA ambiguity in disguise.
Many ways of seeing
Analysis— Why radians are the natural unit
For small angles measured in radians, : the chord and the arc of a thin slice are almost the same length. More precisely, as , and this limit is what makes the derivative of equal to . In degrees, every derivative would carry an extra factor of . Analysis then gives sine and cosine as power series,
valid for every real . These series were found by Mādhava of Saṅgamagrāma in Kerala (14th century) and rediscovered in Europe by Newton and others in the 17th century. Mathlib uses them as the definition. See sequences and series and introductory calculus.
Algebra— Rotations, complex numbers and a group
The rotations of the plane about a point form a group: you can compose them (angles add), there is an identity (turning by ) and every rotation has an inverse (turning back). In complex numbers, rotation by is multiplication by , and Euler's formula turns the addition formulas into the law of exponents . De Moivre's formula then gives multiple-angle formulas for free.
Physics— Waves and oscillations
A mass on a spring, a swinging pendulum (for small swings) and the voltage in an alternating current all follow : amplitude , angular frequency , phase . Sound is pressure varying like this; a pure tone at Hz is . Joseph Fourier showed that very general periodic signals are sums of sines and cosines, an idea at the heart of signal processing, music technology and the analysis of heat flow. See Fourier series.
Geometry— Triangles on a sphere
Astronomers and navigators needed trigonometry on the sphere, where the "sides" of a triangle are arcs of great circles. For a spherical triangle on the unit sphere with sides (measured as angles at the centre), the spherical law of cosines reads . For very small triangles, and , and it turns back into the plane law of cosines — another sign that a small patch of a sphere looks flat. See non-Euclidean geometry.
History and global context
- Greece. Hipparchus of Nicaea (2nd century BCE) is credited with the first table of chords (the chord of an angle in a circle of radius is ). Claudius Ptolemy's Almagest (Alexandria, 2nd century CE) gave a chord table at half-degree steps and proved what amounts to the addition formulas, using a theorem about cyclic quadrilaterals now named after him.
- India. Indian astronomers replaced the chord by the half-chord, which is our sine. Āryabhaṭa's Āryabhaṭīya (499 CE) gives a table of sine differences for steps of in a circle of radius . Brahmagupta (7th century) gave a second-order interpolation rule for such tables, and Mādhava of Saṅgamagrāma (14th century) and the Kerala school found infinite series for sine and cosine.
- The word "sine". The Sanskrit jyā or jīvā (bow-string) became jība in Arabic. Written without vowels, it was later read as jayb, "fold" or "pocket", and translated into Latin as sinus, from which "sine" comes.
- The Islamic world. Al-Battānī (around 900) used sines and tangents in astronomy. Abū al-Wafāʾ al-Būzjānī (10th century) compiled tables of sines and tangents and is one of the mathematicians credited with the law of sines for spherical triangles. Al-Bīrūnī (11th century) estimated the radius of the Earth from the angle at which the horizon dips below the horizontal, seen from a mountain of known height. Naṣīr al-Dīn al-Ṭūsī (13th century) treated trigonometry as a subject in its own right, and Jamshīd al-Kāshī (15th century) computed to great accuracy; in France the law of cosines is called théorème d'Al-Kashi.
- Europe. Regiomontanus wrote On Triangles of Every Kind (1464, printed 1533), and Leonhard Euler (1748) treated sine and cosine as functions of a real number and connected them with the exponential function.
- Surveying. Triangulation, using a measured baseline and the law of sines, mapped countries from the 17th century onwards, including the Great Trigonometrical Survey of India (from 1802).
Further reading
- I. M. Gelfand and Mark Saul, Trigonometry (2001) — a careful, problem-rich course written for strong school students.
- Eli Maor, Trigonometric Delights (1998) — history and ideas, from Egypt to Fourier.
- Glen Van Brummelen, The Mathematics of the Heavens and the Earth: The Early History of Trigonometry (2009) — Greece, India, the Islamic world and Europe.
- Tom M. Apostol, Calculus, Volume 1 (1967) — for the analytic definition of sine and cosine and their derivatives.