21 Trigonometry
21 Trigonometry
21 Trigonometry
12-Sep-19
Instant Trig
Trigonometry is math, so many people find it scary
It’s usually taught in a one-semester high-school course
However, 95% of all the “trig” you’ll ever need to know
can be covered in 15 minutes
And that’s what we’re going to do now
Angles add to 180°
The angles of a triangle always add up to 180°
20°
44°
30°
68° 68° 120°
20°
44°
30°
68°
+ 130°
+ 68°
180°
180°
Right triangles
We only care about right triangles
A right triangle is one in which one of the angles is 90°
Here’s a right triangle:
Here’s the angle
we are looking at
Here’s the
opposite
right angle
adjacent
32 + 42 = 52, or 9 + 16 = 25
25 + 144 = 169
Ratios
Since a triangle has three
opposite
sides, there are six ways to
divide the lengths of the sides
Each of these six ratios has a adjacent
name (and an abbreviation)
Three ratios are most used: The ratios depend on the
sine = sin = opp / hyp shape of the triangle (the
cosine = cos = adj / hyp angles) but not on the size
tangent = tan = opp / adj
opposite
The other three ratios are
redundant with these and can
adjacent
be ignored
Using the ratios
With these functions, if you know an angle (in addition to the
right angle) and the length of a side, you can compute all other
angles and lengths of sides
opposite
adjacent
If you know the angle marked in red (call it A) and you know
the length of the adjacent side, then
tan A = opp / adj, so length of opposite side is given by
opp = adj * tan A
cos A = adj / hyp, so length of hypotenuse is given by
hyp = adj / cos A
Java methods in java.lang.Math
public static double sin(double a)
If a is zero, the result is zero
public static double cos(double a)
public static double sin(double a)
If a is zero, the result is zero
opposite
hyp
opp