Almost every problem in a machine shop comes down to this: you know some measurements, and you need to find others. Trigonometry is just the toolkit for doing that with angles and right triangles.
You're drilling a hole 32 mm across from the edge of a part, and it needs to be at 38°. How far in the Y-axis do you move? How far in X? This is trig — used every day, every shift.
The Right Triangle Geometry
A right triangle has one 90° corner. Shop trig uses right triangles because machines move on orthogonal lines (X and Y axes). Adjust the slider below to see how the triangle's sides respond to changing the angle θ.
Naming the Sides
The side names change depending on which angle you reference. Always start by identifying your angle θ (theta):
- Hypotenuse — Always the longest side, opposite the 90° corner. Fixed.
- Opposite — The side directly across from your angle θ.
- Adjacent — The side right next to your angle θ.
Always verify your scientific calculator is set to DEG (Degrees), not RAD (Radians). In machining, everything is degrees. If sin(30) returns negative, you're in radians.
SOH-CAH-TOA is an acronym for the three primary trigonometric ratios. Each establishes a relationship between an angle and two sides.
By rearranging these, we generate the formulas used directly at the machine controller:
Interactive Right Triangle Calculator
Knowledge Check
A Pitch Circle Diameter (PCD) is a series of holes spaced evenly around a center point. To drill these manually or via basic CNC, you must convert polar coordinates (Radius and Angle) into Cartesian coordinates (X and Y limits).
Bolt Circle Generator
| # | X | Y |
|---|
Knowledge Check
A taper is mathematically an isosceles triangle wrapped around an axis. When setting a compound slide or programming a CNC lathe (G01 X Z), we care about the half angle (α/2) and the linear distance traveled.
Taper Calculator
A sine bar creates a physical hypotenuse. You stack gauge blocks to raise one end (Opposite) to achieve a highly precise angle.
Always set the manual engine lathe's compound to the half-angle of the desired taper to feed cleanly along one face.
Converting a polar tool path (Distance at Angle) into Cartesian G-code (X, Y).
Rotating an entire geometry feature by angle φ dynamically.
You have unlocked all modules and reviewed the core machine shop trigonometry formulas. Your math is now as dialed in as your machines.
Trig-CNC was developed to bridge the gap between abstract trigonometry and the practical, high-precision world of the machine shop. While computer-aided design (CAD) is everywhere, a machinist's true power comes from understanding the math that runs the machine.
Purpose
This application serves as both a reference and a training tool. Whether you are solving for a bolt circle PCD, calculating a Morse taper half-angle, or programming a coordinate rotation, Trig-CNC provides the formulas and interactive visualizers to ensure your first cut is your best cut.
Technical Details
Built with modern web technologies to be lightweight, portable, and responsive:
- Frontend: Vanila HTML5, CSS3 (Custom Variables & Animations)
- Physics: p5.js Particle System
- Visuals: Interactive SVG Geometry
This project is designed to be a standalone, single-file tool. It can be run offline once loaded, making it ideal for shop-floor tablets and workstations.