Portland, Oregon on Google Earth
The study of triangles goes way back, and for a good reason: you often want to know distances it would be impractical to measure directly, but given locally obtainable information, you are able to deduce, by the laws of trigonometry, what the unknown measure is.
Put another way: trigonometry allows us to fill in the blanks regarding a triangle, provided only a few blanks (how few?) are filled in.
For example: how many miles apart are those two mountain peaks? How tall are they? How long will it take me to reach them on foot? We summarize all this information in what we call a map. When you are on an expedition, the map is among the most precious artifacts you have.
The map, and your ability to read it, is what keeps you "on track" and moving towards your intended destination. The alternative: to get lost and wander. That can be fun unless you're in danger because depending on a very finite supply of provisions.
This is why intrepid adventurers would go forth into the unknown in the first place: to make new maps. This process is also known as surveying. To survey a territory is to map it thoroughly. Explorers would head off for "unknown" parts of the world, map it, and claim it for their king.
Once a king assumes entitlement to some land, there's the matter of divvying it up among his friends, rewarding them for their loyalty. The services of surveyors is once again required: to demarcate a newly claimed land into plots or properties. The establishment of property lines requires knowledge of trigonometry.
If I tell you the two sides of a triangle, have I told you enough to know exactly which triangle I mean? If so, you might build a congruent one, based on just the information I have given. But no, the two edges might "scissor" without changing length. That variable angle between the two edges is what leaves the triangle unspecified. Lock in that angle, and you're ready to deduce the 3rd side, and the remaining angles.
Another core feature of trigonometry are its coordinate systems, in particular the spherical coordinate system, which it marries up to XYZ, making these Vector types interconvertible.
from qrays import Vector, Svector
? Svector
Init signature: Svector(arg) Docstring: Subclass of Vector that takes spherical coordinate args. Init docstring: initialize a vector at an (r,phi,theta) tuple (= arg) File: ~/Documents/elite_school/qrays.py Type: type Subclasses:
v = Svector((1, 45, 45))
v
Svector (1.00000000000000, 45.0000000000000, 45.0000000000000)
v.xyz
xyz_vector(x=0.500000000000000, y=0.500000000000000, z=0.707106781186548)
Exercise
Initialize several Svectors and try to guess the output in terms of xyz.
v = Svector((4, 90, 90))
v
Svector (4.00000000000000, 90.0000000000000, 90.0000000000000)
v.xyz
xyz_vector(x=2.44929359829471e-16, y=4.00000000000000, z=2.44929359829471e-16)
Astronomy is about synchronizing our clocks and calendars, by tracking the stars and planets.
Pointing to stars and constellations very precisely takes a spherical coordinate system that's also sensitive to the Earth's rotation around its own axis, as well as to its orbital position with respect to the sun. The Earth gets to be at the origin of a coordinate system of its own, for the purpose of some of the lookup tables, even though we consider the sun to be an anchoring object in another sense.
The world of trigonometry is that of sundials and shadows, navigation, spherical coordinates, global positioning, and satellites. We use trigonometry to answer the all important question: where am I right now, in space and time?
The trigonometric functions appear on scientific calculators, right next to the log keys. This makes them relevant to high school, wherein practically everything a scientific calculator does gets covered, and then some.
Any key that makes it to a scientific calculator must be pretty important, as "real estate" on a keypad is pretty tight. Computers do not suffer from these same constraints -- unless emulating a calculator of course.
import math
from math import cos, sin, tan, acos, asin, atan, radians, degrees
The number of degrees around a circle of unit radius, or any radius, is 360. Each degree takes you 1/360th of the way around a circle, in steps of one degree.
A standard 12-hour clock face has 60 minutes around the perimeter, marked with ticks. A minute is 6 degrees, as 6 times 60 = 360, one complete rotation.
The second hand treats a minute as 60 seconds, so the tick marks stand for 1/60th of a minute, a single second. The second hand moves one 1/60th of one revolution per one second of time.
circle_degrees = range(0, 361) # [0, 360] or [0, 361) among ints
A unit radius circle has perimeter (circumferance) of exactly $2 \pi$. So every degree is 1/360th of that total distance.
We measure the distance around the perimeter of a unit radius circle in radians, and then have degree equivalents.
from math import pi
circumference = 2 * pi
one_degree_in_radians = 2 * pi / 360
one_degree_in_radians
0.017453292519943295
radians(1) # degree input
0.017453292519943295
radians(6) # radians in one minute on a clock
0.10471975511965978
radians(6) * 60 # a full hour
6.283185307179587
2 * pi
6.283185307179586
The trig functions get introduced in two ways. Starting with any right triangle, of any size, the focus is on ratios between edges.
Pick an angle on a right triangle that is not the right angle. Call this angle theta.
Now we have two edges, or legs, that are not the hypotenuse (not opposite the right angle), or Hyp for short.
The edge that is "adjacent" to theta, forming one of its sides, has length Adj. The edge that is "opposite" theta may be called edge Opp.
Here's what we say:
$$ \cos (\theta) = \frac{Adj}{Hyp} $$$$ \sin (\theta) = \frac{Opp}{Hyp} $$$$ \tan (\theta) = \frac{Opp}{Adj} $$For example, say the opposite and adjacent sides have equal length, and it's a right triangle. Therefore we know the length of the hypotenuse, by the Pythagorean Theorem. We also know what the value of $\theta$ has to be: 45 degrees. Because it's essentially bisecting the angle of a square (90 degrees).
By this reasoning, the sine and cosine of 45 degrees should be:
$$ \frac{x}{\sqrt{2x^{2}}} $$The trig functions expect their argument to be in radians though, so:
cos(radians(45))
0.7071067811865476
sin(radians(45))
0.7071067811865475
def edge_hyp_ratio(x):
return x / math.sqrt(2 * x**2)
edge_hyp_ratio(4)
0.7071067811865475
edge_hyp_ratio(2.5)
0.7071067811865475
The value of x does not matter. The ratio is the same regardless.
The other way by which trigonometric functions are often introduced is by means of a "unit circle".
We still use right triangles, but hold the hypotenuse fixed, with a value of 1. The two legs correspond to distances along the x and y axes between -1 and 1.
The same ratios apply, as above, however Hyp = 1.
Starting with some angle $\alpha$ between 0 and 360, we are able to use cosine and sine to get the corresponding point on the unit circle in (x, y) coordinates or as a Vector in other words.
$x = \cos(\alpha)$ and $y = \sin(\alpha)$
If you already know the ratio N and want to find the angle, that's where the inverse functions come in, as:
$\arccos(N)$ and $\arcsin(N)$
or as:
acos(N)
and asin(N)
in Python, or as
$\cos^{-1}(N)$ and $\sin^{-1}(N)$
with the -1 exponent in this case signifying these are "inverse functions" going from ratio to angle versus angle to ratio.
degrees(acos(edge_hyp_ratio(4)))
45.00000000000001
degrees(asin(edge_hyp_ratio(5))) # ratio(N) always returns the same thing
44.99999999999999
degrees(atan(1))
45.0
Our purpose here is not to aim for encyclopedic inclusivity, but to serve as a node, stub, springboard, to neighboring resources, some of them Notebooks within the same curriculum outline, more of them not. The opening of a new unknown to our surveying and omni-triangulating does not end with the maps we've got so far. Exploration continues. We need the tools and some methods. Then we need to get out in the field and work it (field test it).
These pages were first developed at a rate of roughly two per week, over the course of one summer. They've been worth going back to and fleshing out more.