The unit circle defines sine and cosine as coordinates. Every trig identity follows from the fact that the point (cosθ, sinθ) sits on a circle of radius 1. Trig functions are periodic: they repeat every 2π.
The unit circle
Place a point on the unit circle at angle θ from the positive x-axis. Its x-coordinate is cosθ, its y-coordinate is sinθ. Since the point is on a circle of radius 1, cos²θ + sin²θ = 1. This is the Pythagorean identity.
Scheme
; Unit circle: cos^2(theta) + sin^2(theta) = 1; BiwaScheme has sin, cos built in
(define pi 3.141592653589793)
; Key angles in radians
(define angles (list 0 (/ pi 6) (/ pi 4) (/ pi 3) (/ pi 2) pi))
(define names (list "0""pi/6""pi/4""pi/3""pi/2""pi"))
(define (show-angle name theta)
(let ((c (cos theta)) (s (sin theta)))
(display name) (display ": cos=")
(display (/ (round (* c 1000)) 1000))
(display " sin=")
(display (/ (round (* s 1000)) 1000))
(display " sum=")
(display (/ (round (* (+ (* c c) (* s s)) 1000)) 1000))
(newline)))
(for-each show-angle names angles)
tanθ = sinθ/cosθ. It is undefined when cosθ = 0 (at π/2, 3π/2). Sine is odd, cosine is even. All three functions are periodic.
Scheme
; sin, cos, tan relationships
(define pi 3.141592653589793)
(define (my-tan x) (/ (sin x) (cos x)))
; Verify tan = sin/cos
(display "tan(pi/4) = ") (display (/ (round (* (my-tan (/ pi 4)) 1000)) 1000)) (newline)
; Should be 1.0; sin is odd: sin(-x) = -sin(x)
(display "sin(pi/3) = ") (display (/ (round (* (sin (/ pi 3)) 1000)) 1000)) (newline)
(display "sin(-pi/3) = ") (display (/ (round (* (sin (- (/ pi 3))) 1000)) 1000)) (newline)
; cos is even: cos(-x) = cos(x)
(display "cos(pi/3) = ") (display (/ (round (* (cos (/ pi 3)) 1000)) 1000)) (newline)
(display "cos(-pi/3) = ") (display (/ (round (* (cos (- (/ pi 3))) 1000)) 1000))
Python
importmath# tan = sin/cosprint("tan(pi/4) = {:.3f}".format(math.tan(math.pi/4))) # 1.0# sin is odd: sin(-x) = -sin(x)print("sin(pi/3) = {:.3f}".format(math.sin(math.pi/3)))
print("sin(-pi/3) = {:.3f}".format(math.sin(-math.pi/3)))
# cos is even: cos(-x) = cos(x)print("cos(pi/3) = {:.3f}".format(math.cos(math.pi/3)))
print("cos(-pi/3) = {:.3f}".format(math.cos(-math.pi/3)))
Key identities
The Pythagorean identity generates the rest. Angle-sum formulas let you expand sin(a+b) and cos(a+b). Double-angle formulas are a special case. These are not arbitrary: they all follow from the geometry of the circle.
arcsin, arccos, arctan undo sin, cos, tan on restricted domains. arcsin maps [-1,1] to [-π/2, π/2]. arctan maps all reals to (-π/2, π/2). These are essential for integration later.
Scheme
; Inverse trig: asin, acos, atan
(define pi 3.141592653589793)
; asin(sin(x)) = x for x in [-pi/2, pi/2]
(display "asin(sin(pi/6)) = ") (display (/ (round (* (asin (sin (/ pi 6))) 10000)) 10000)) (newline)
; Should be pi/6 = 0.5236; atan(1) = pi/4 (since tan(pi/4) = 1)
(display "atan(1) = ") (display (/ (round (* (atan 1) 10000)) 10000)) (newline)
; Should be pi/4 = 0.7854; atan2 handles all four quadrants
(display "atan2(1, 1) = ") (display (/ (round (* (atan 11) 10000)) 10000)) (newline)
(display "atan2(-1, -1) = ") (display (/ (round (* (atan -1-1) 10000)) 10000))
; -3pi/4 = -2.3562
Python
importmath# asin(sin(x)) = x for x in [-pi/2, pi/2]print("asin(sin(pi/6)) = {:.4f}".format(math.asin(math.sin(math.pi/6))))
# Should be pi/6 = 0.5236# atan(1) = pi/4print("atan(1) = {:.4f}".format(math.atan(1))) # 0.7854# atan2 handles all four quadrantsprint("atan2(1, 1) = {:.4f}".format(math.atan2(1, 1)))
print("atan2(-1, -1) = {:.4f}".format(math.atan2(-1, -1)))