Mathematical concepts
Sine, cosine and tangent
Also called: SOH CAH TOA · trig ratios · trigonometry
Definition
In a right-angled triangle, sine is opposite over hypotenuse, cosine is adjacent over hypotenuse and tangent is opposite over adjacent, each a function of the angle.
Picture it
Imagine a rotating arm of length 1: cosine is how far across its tip is, sine is how far up. Scale the arm and every length scales with it. That is why a robot arm of length L at angle θ has its tip at (L cos θ, L sin θ).
The maths
sin θ = opp / hyp cos θ = adj / hyp tan θ = opp / adj = sin θ / cos θ
| Quantity | Unit | Symbol |
|---|---|---|
| ratio | dimensionless | 1 |
| angle | radian | rad |
| angle | degree | ° |
Worked example
A ramp rises 0.5 m over a slope length of 2.0 m. What is its angle, and how long is it horizontally?
- sin θ = 0.5 / 2.0 = 0.25
- θ = asin 0.25 = 14.5°
- adj = 2.0 × cos 14.5° = 1.94 m
Answerθ ≈ 14.5°; horizontal run ≈ 1.94 m.
✓ The 2 numbers in this answer are recomputed from scratch by an automated test.
SOH CAH TOA
Trig ratios on a rotating arm
Arm tip: x = 0.866 m, y = 0.5 m
The arm tip sits at (L cos θ, L sin θ). In code, convert degrees to radians first.
Common misconceptions
- Misconception: tan 90° is undefined, not very big; the adjacent side is zero.
- Misconception: sin² θ means (sin θ)², not sin(θ²).