Trigonometry
Trigonometry is the branch of mathematics that relates angles to lengths. It’s used every day in the workshop, even when you don’t call it by name: to find the height of a tilted plane, the angle of a ramp, the length of a drill bit, the coordinates of holes in a flange, or the distance between two holes in a circle. In this chapter, we’ll derive sine, cosine, and tangent starting from a circle, learn how to use them in right triangles and general triangles, and conclude with the polar coordinates used in CNC machines.
5.1 Angles: Degrees and Radians
An angle is the portion of a plane bounded by two rays that originate from the same point, the vertex. In Chapter 2, we learned about the two units used to measure angles: the degree (a full circle is 360°) and the radian (a full circle is 2π rad). Here we need one more thing: in trigonometry, angles have a direction. They are measured starting from the positive x-axis and are positive when measured counterclockwise and negative when measured clockwise. Thus, −90° and 270° point in the same direction, and an angle can even exceed a full circle: 400° is one full circle plus 40°.
It's the same convention used in numerical control: on the XY plane of a milling machine (G17), the 0° angle corresponds to the X+ direction, 90° corresponds to Y+, and the angles increase as you move from X+ toward Y+.
The calculator calculates up to 30°. In DEG mode, it displays 0.5. If the calculator is still in RAD mode, it reads “30 radians” and displays:
5.2 The goniometric circle
To define the sine and cosine of any angle—including obtuse or negative angles—we use a circle of radius 1 centered at the origin of the coordinate axes: the trigonometric circle. A ray is drawn from the origin, inclined by an angle α relative to the x-axis; the point where it intersects the circle is point P.
- The cosine of α is the x-coordinate of P (how far P is to the right or left of the center);
- The arc length of α is the ordinate of P (how far P is above or below the center);
- The tangent to α is the y-coordinate of point T, where the extended ray intersects the vertical line x = 1.
Two things are immediately apparent from the figure. Since P lies on a circle of radius 1, the sine and cosine are always between −1 and +1. The tangent, on the other hand, can be as large as you like: as α approaches 90°, the ray becomes almost vertical and intersects the line x = 1 at an increasingly higher point; at exactly 90°, it no longer intersects the line, and the tangent does not exist.
5.3 Sine, Cosine, and Tangent in a Right Triangle
In the goniometric circle, the radius OP, its projection onto the x-axis, and the vertical segment form a right triangle with a hypotenuse of length 1. If the triangle is larger, all sides increase in the same proportion (the triangles are similar, Chapter 3), so the ratios between the sides remain the same. This leads to the definitions used in the workshop, which apply to the acute angles of any right triangle.
A right-angled sheet metal triangle has legs measuring 30 mm and 40 mm and a hypotenuse of 50 mm. α is the angle opposite the 30 mm leg.
5.4 The Fundamental Relationship
On the unit circle, point P has coordinates (cos α; sin α) and is 1 unit away from the center. The Pythagorean theorem (Chapter 3), applied to the triangle formed by O, P, and the foot of the arc at P, yields the most important formula in trigonometry, which holds for any angle:
For an angle α, we know that sin α = 0.6 and that it is an obtuse angle (between 90° and 180°). Find cos α, tan α, and α.
5.5 Notable Values
For some angles, sine and cosine can be determined without a calculator, using two triangles that every technician has on their workbench: the 45° set square is half a square, and the 30° and 60° set square is half an equilateral triangle. Using the Pythagorean theorem, you can find the missing sides, and the ratios give the exact values.
| Corner | Radiant | sin | cos | tan |
|---|---|---|---|---|
| 0° | 0 | 0 | 1 | 0 |
| 30° | π/6 | 1/2 = 0,5 | √3/2 = 0,8660 | √3/3 = 0,5774 |
| 45° | π/4 | √2/2 = 0,7071 | √2/2 = 0,7071 | 1 |
| 60° | π/3 | √3/2 = 0,8660 | 1/2 = 0,5 | √3 = 1,7321 |
| 90° | π/2 | 1 | 0 | does not exist |
5.6 The signs in the four quadrants and their associated angles
The axes divide the plane into four quadrants, numbered counterclockwise starting from the top right. Since the cosine is the x-coordinate of P and the sine is its y-coordinate, the signs can be determined directly from the position of P: to the left of the y-axis, the cosine is negative; below the x-axis, the sine is negative. The tangent, which is the ratio of the two, is positive when they have the same sign.
The symmetries of the figure allow any angle to be transformed into an acute angle—the one we are familiar with. These are called associated angles:
5.7 The Sine and Cosine Graphs
If you rotate P around the goniometric circle and draw the sine (its height) as a function of the angle, you get a wave: the sine wave. The cosine yields the same wave shifted back by 90°. Both repeat identically with each rotation: they are periodic functions with a period of 360° (2π).
- The sine is 0 at 0°, 180°, and 360°; it is maximum (+1) at 90° and minimum (−1) at 270°;
- The cosine is +1 at 0° and 360°, −1 at 180°, and zero at 90° and 270°;
- The tangent function does not have a waveform like that: it ranges from −∞ to +∞ and repeats every 180°, with a jump at 90° and 270°, where it does not exist.
Sine waves aren’t just something you see in school drawings. The voltage of the electrical grid is a 50-Hz sine wave (Chapter 44); the position of a point on the edge of a rotating workpiece, viewed from the side, rises and falls in proportion to the sine of the angle; the signals from an incremental encoder (Chapter 47) are two sine waves phase-shifted by 90°, just like sine and cosine, and by comparing them, the controller determines the direction of rotation.
5.8 Inverse Functions and the Quadrant Problem
Often the problem is the other way around: you know the sides and are looking for the angle. You need the inverse functions, which on a calculator are the sin⁻¹, cos⁻¹, and tan⁻¹ keys (usually with SHIFT or 2nd). The ⁻¹ here doesn’t mean “one divided by”: it means “the angle with this sine value.”
Those result ranges are the tricky part. An equation like sin α = 0.5 has two solutions in one rotation—30° and 150°—but the calculator gives only one. With the tangent function, the problem is more serious, and it arises when finding the angle of a point with coordinates (x; y): the angle is arctan(y/x), but the ratio y/x loses its sign. The points (−30; 40) and (30; −40) have the same ratio, and the calculator gives the same angle for both.
Find the distance from the origin and the angle of the points P(−30, 40) and Q(−30, −40).
5.9 The Calculator: DEG, RAD, and GRAD
Scientific calculators have three angle modes, which are indicated in small print on the display:
- DEG (or D): sexagesimal degrees; a full circle is 360°. This is the unit used for drawings and numerical controls;
- RAD (or R): radians; one rad is 2π. It is used in physics formulas, for example with angular velocity ω (Chapter 9);
- GRAD (or G): centesimal degrees (gon); one full rotation is 400 gon. It is used in surveying, but almost never in a workshop.
| It is written as "sin 30" in | The calculator is designed to | Result |
|---|---|---|
| DEG | 30° | 0,5 ✓ |
| RAD | 30 rad = 1718.9° | −0,988 |
| GRAD | 30 gon = 27° | 0,454 |
Other rules to help you avoid errors:
- An angle in degrees and minutes (for example, 29°30′) must first be converted to decimal degrees (29.5°), as described in Chapter 2, or entered using the appropriate key (° ′ ″);
- On many calculators, sin² α is written as
(sin(35))²: the parentheses around the sine are necessary; otherwise, it calculates the sine of 35²; - arcsin and arccos return a “Math ERROR” if the number is greater than 1: this usually means that you have divided the longer side by the shorter side;
- Spreadsheets and almost all programming languages always use radians: in Excel, you would write =SEN(RADIANS(30)).
5.10 Solving Right Triangles
Solving a triangle means finding all its sides and angles based on the known ones. In a right triangle, one angle is already known (90°), so only two pieces of information are needed, at least one of which must be a side. There are four possible cases:
| Known Data | How to Find Others |
|---|---|
| hypotenuse c and an angle α | a = c · sin α · b = c · cos α · β = 90° − α |
| one leg and one angle (for example, b and α) | a = b · tan α · c = b / cos α · β = 90° − α |
| the two legs, a and b | c = √(a² + b²) · α = arctan(a / b) · β = 90° − α |
| hypotenuse c and a leg (for example, a) | b = √(c² − a²) · α = arcsin(a / c) · β = 90° − α |
A practical tip: At the end, always check your result using a calculation different from the ones you used—for example, the Pythagorean theorem if you worked with angles, or the sum of the angles if you worked with sides. And the longest side must be the hypotenuse.
A 2.5-meter-long loading ramp is inclined at a 12° angle to the floor. What is its maximum height, and how much floor space does it occupy?
A ramp for carriages must rise 150 mm over a horizontal distance of 1,200 mm. What is its angle, its slope, and how long is the sheet metal?
A typical example of a “cathetus and angle” is a drill bit. Tapered drill bits for steel have a point angle of 118°: viewed from the side, the cone of the bit is formed by two right triangles with a leg of D/2 and an angle of 59° toward the axis. The length of the cone must be added to the hole depth when planning a through hole (Chapter 28).
A Ø10 drill bit with a 118° angle must pass through a 15-mm plate. How far must it extend beyond the bottom surface for the hole to be complete?
A wall-mounted shelf has a 300-mm-long diagonal brace (measured between the two holes), which is attached to the shelf 180 mm from the wall. At what height below the shelf should the hole be drilled in the wall, and at what angle should the brace be cut?
5.11 General Triangles: The Law of Sines
When a triangle does not have a right angle, the sine, cosine, and tangent can no longer be interpreted as ratios of the sides. We need two theorems that hold for all triangles. To write them, we use a standard notation: the vertices are labeled A, B, and C; the angles are labeled α, β, and γ; and the sides are labeled a, b, and c, where each side lies opposite the angle with the same letter.
The height h, as seen from the two right triangles in the figure, is given by h = b · sin α and also h = a · sin β. Setting these equal yields a / sin α = b / sin β, and the same reasoning applies to the other pair: this is the law of sines.
Three holes, A, B, and C, are drilled in a plate: the distance between B and C is 80 mm; the drawings show the angles α = 40° at A and β = 65° at B. Find the other two distances and the diameter of the circle that passes through the three holes.
When two sides and the angle opposite one of them are given, the theorem yields the sine of an angle, and one sine corresponds to two possible angles, β and 180° − β (Section 5.6). If both sides give rise to a third angle, there are two possible triangles: this is an ambiguous case, and only the drawing indicates which one is correct.
For a triangle, we know that a = 70 mm, b = 90 mm, and α = 40°. Find β, γ, and c.
5.12 Carnot's Theorem and the Area of a Triangle
The law of sines is not sufficient when two sides and the angle between them are known, or when all three sides are known: in those cases, no pair of sides and their opposite angles is known. We need Carnot’s theorem (also known as the cosine theorem), which is a “corrected” version of the Pythagorean theorem for non-right triangles.
A triangular bracket has two sides measuring 120 mm and 90 mm, which form a 70° angle. How long is the third side?
Another angle bracket has sides a = 120 mm, b = 90 mm, and c = 110 mm. What are its angles?
The breast area
The area of a triangle is the base times the height divided by two (Chapter 3). If we take side a as the base, the height on its extension is b · sin γ, and we obtain a formula that does not require measuring the height: all we need are two sides and the angle between them.
The bracket shown in Example 5.12 (sides 120 and 90 mm, angle 70°) is cut from a 10-mm-thick steel sheet. How much does it weigh, not counting holes and radii?
5.13 Polar and Cartesian Coordinates
A point on a plane can be described in two ways. Cartesian coordinates (X; Y) specify how far to move along the two axes. Polar coordinates (R; A) specify the distance R from the origin (the pole) and the angle A, measured counterclockwise from the X-axis. The transition from one set of coordinates to the other is represented by a right triangle with hypotenuse R.
On the other hand, the point X = −25, Y = −40:
Polar coordinates on the numerical control panel
When a drawing is dimensioned with radii and angles, CNC controls allow you to program directly in polar coordinates, without having to do the calculations. On Fanuc controls for milling machines, the function is activated by G16 and ends with G15: In plane G17, while G16 is active, the X address becomes the radius and the address Y is thecorner in degrees. In absolute coordinates (G90), the pole is the work zero. On Siemens machines, the pole is set using G111 and the period is written as RP= (radius) and AP= (corner).
T01 M06 (PUNTA D10) G90 G17 G54 G00 X0 Y0 S1000 M03 (ZERO PEZZO AL CENTRO DELLA FLANGIA) G43 H01 Z50. G16 (COORDINATE POLARI ATTIVE) G81 X50. Y0 Z-15. R2. F120 (FORO 1: RAGGIO 50, ANGOLO 0) Y60. (FORO 2) Y120. (FORO 3) Y180. (FORO 4) Y240. (FORO 5) Y300. (FORO 6) G80 G15 (CICLO SPENTO, POLARI SPENTE) G00 Z50. M30
The program drills the 6 holes in the flange described in the next paragraph: the radius remains 50, and only the angle changes. The program automatically performs the sine and cosine calculations, which we’ll look at shortly. Knowing how to do these by hand remains essential—to check the program, for operations that don’t use polar coordinates, and to measure the finished part.
5.14 Circles of Holes
Flanges, covers, hubs, and discs often have identical holes arranged in a circle at a constant angular pitch. The drawing specifies the pitch diameter (or center diameter) D, the number of holes n, and the position of the first hole; unless polar coordinates are used, the program requires the X and Y coordinates of each center. This is the most common application of trigonometry in milling.
Flange with 6 holes on a pitch diameter of 100 mm; the first hole is on the X+ axis, with the workpiece centered.
Cover with 8 holes on a Ø100. To ensure that no hole aligns with the axes, the first hole is at a 22.5° angle.
| Forum | Corner | X (mm) | Y (mm) |
|---|---|---|---|
| 1 | 22,5° | 46,194 | 19,134 |
| 2 | 67,5° | 19,134 | 46,194 |
| 3 | 112,5° | −19,134 | 46,194 |
| 4 | 157,5° | −46,194 | 19,134 |
| 5 | 202,5° | −46,194 | −19,134 |
| 6 | 247,5° | −19,134 | −46,194 |
| 7 | 292,5° | 19,134 | −46,194 |
| 8 | 337,5° | 46,194 | −19,134 |
To check the flange with a caliper, measure the distance between the centers of the holes. What should the measurement be?
G16—and the holes should be drilled at exactly the same points. If they aren't, the error is usually in the sign of a coordinate or in the first angle.5.15 The Formulas in This Chapter
| What | Formula |
|---|---|
| Degrees and radians | rad = degrees · π / 180 · degrees = rad · 180 / π |
| Right-angled triangle | sin α = a / c · cos α = b / c · tan α = a / b |
| Bribe | tan α = sin α / cos α |
| Key Report | sin² α + cos² α = 1 |
| Related Angles | sin(180° − α) = sin α · cos(180° − α) = −cos α · sin(−α) = −sin α · cos(−α) = cos α |
| Angle of a point | θ = arctan(y / x), plus 180° if x < 0 · θ = atan2(y; x) |
| Sides of a right triangle | a = c · sin α · b = c · cos α · a = b · tan α · c = √(a² + b²) |
| Slope | slope (%) = tan α × 100 |
| Law of Sines | a / sin α = b / sin β = c / sin γ = 2R |
| Carnot's Theorem | c² = a² + b² − 2ab · cos γ · cos γ = (a² + b² − c²) / (2ab) |
| Area of a triangle | A = ½ · a · b · sin γ |
| From polar to Cartesian | X = R · cos A · Y = R · sin A |
| From Cartesian to Polar | R = √(X² + Y²) · A = atan2(Y; X) |
| Circle of Holes | θi = θ1 + (i − 1) · 360° / n · Xi = Xc + D/2 · cos θi · Yi = Yc + D/2 · sin θi |
| Distance between two holes | s = D · sin(Δθ / 2) · for adjacent holes: s = D · sin(180° / n) |
5.16 Exercises
Try to solve them on your own, using the calculator in DEG mode, before looking at the solution. In Chapter 6, trigonometry returns to more complex practical problems.
Solution
72 · 3.14159 / 180 = 1.2566 rad (i.e., 2π/5); 1.2 · 180 / 3.14159 = 68.755°.
Solution
c = √(576 + 4900) = √5476 = 74 mm. The angle opposite the 24-unit side: arctan(24 / 70) = arctan 0.34286 = 18.92°; the other angle: 90° − 18.92° = 71.08°.
Solution
cos² α = 1 − 0.0784 = 0.9216 → cos α = −0.96 (second quadrant); tan α = 0.28 / (−0.96) = −0.2917; arcsin 0.28 = 16.26° → α = 180° − 16.26° = 163.74°.
Solution
sin 120° = sin 60° = 0.8660; cos 135° = −cos 45° = −0.7071; tan 240° = tan 60° = 1.7321 (third quadrant, positive tangent); cos 300° = cos 60° = 0.5.
Solution
h = 3000 · sin 8° = 3000 · 0.13917 = 417.5 mm; b = 3000 · cos 8° = 3000 · 0.99027 = 2970.8 mm.
Solution
b = 400 / 0.08 = 5,000 mm; α = arctan 0.08 = 4.574°; L = √(5,000² + 400²) = √25,160,000 = 5,016.0 mm.
Solution
70° semi-angle: l = 10 / tan 70° = 10 / 2.7475 = 3.640 mm.
Solution
β = 180° − 35° − 100° = 45°. c / sin γ = 150 / 0.98481 = 152.31; a = 152.31 · sin 35° = 152.31 · 0.57358 = 87.36 mm; b = 152.31 · sin 45° = 152.31 · 0.70711 = 107.70 mm.
Solution
AB² = 80² + 60² − 2 · 80 · 60 · cos 50° = 6400 + 3600 − 9600 · 0.64279 = 10,000 − 6,170.8 = 3,829.2; AB = √3,829.2 = 61.88 mm.
Solution
A = ½ · 70 · 85 · sin 115° = 2975 · 0.90631 = 2696.3 mm² (sin 115° = sin 65°).
Solution
Step 72°, radius 40. Hole 1 (90°): (0; 40). Hole 2 (162°): (−38.042; 12.361). Hole 3 (234°): (−23.511; −32.361). Hole 4 (306°): (23.511; −32.361). Hole 5 (378° = 18°): (38.042; 12.361).
Solution
Adjacent holes: s = 150 · sin(180° / 12) = 150 · sin 15° = 150 · 0.25882 = 38.82 mm. There are 4 steps from hole 1 to hole 5: Δθ = 120°, s = 150 · sin 60° = 129.90 mm.
Solution
R = √(1225 + 400) = √1625 = 40.31 mm. x > 0: arctan(−20 / 35) = arctan(−0.57143) = −29.74°, that is, 360° − 29.74° = 330.26° (fourth quadrant).
Solution
The largest angle is opposite the longest side: cos γ = (50² + 70² − 90²) / (2 · 50 · 70) = (2500 + 4900 − 8100) / 7000 = −0.1 → γ = 95.74° (obtuse, negative cosine). Area = ½ · 50 · 70 · sin 95.74° = 1750 · 0.99499 = 1741.2 mm² (the same result is obtained using Heron’s formula).
