Radians to Gradians: Bridging Math Libraries and Surveying Software
Radians to gradians conversion — multiply by 200/π — is the handoff formula between mathematical software and surveying instruments. Your Python script computes an azimuth using atan2() and gets 1.2566 radians. The Leica total station on the jobsite expects 80 gon. The 200/π factor bridges that gap, and getting it wrong shifts your stakeout point by meters.

The Conversion Formula: × 200/π
gradians = radians × (200 / π)
A full circle is 2π radians and 400 gradians. Divide: 400 / 2π = 200/π ≈ 63.6620. That constant converts any radian value to gradians. The inverse — gradians back to radians — uses π/200 ≈ 0.015708. Our gradians to radians converter covers that direction.
Unlike the degrees-to-gradians conversion (a clean 10/9 ratio), this formula involves π. Every result is irrational unless the radian input is itself a fraction of π — like π/2 → exactly 100 gon.
Why Your Software Outputs Radians
Trig functions in every major language — Math.atan2() in JavaScript, numpy.arctan2() in Python, atan2() in C — return radians. It's not a design choice anyone made recently. The C math library standardized on radians in the 1970s because radians make derivative-heavy numeric computations simpler, and every language since inherited that convention.
Surveying software went a different direction. Instruments from Leica, Trimble, and Topcon default to gradians in most European markets because a right angle is 100.0000 gon — clean for decimal-based field arithmetic. When you plug these two worlds together — code that computes in radians feeding into software that expects gon — the 200/π conversion sits at the seam.
A Real Data Pipeline: Python to Leica GeoOffice
Here's a pipeline you'd see in a European survey office:
- Field crew records raw angle observations in gon from a Leica TS16 total station. A bearing might read 137.4582 gon.
- Adjustment software (Python/C++) imports the readings and converts to radians: 137.4582 × (π/200) = 2.1605 rad. All least-squares adjustment and coordinate geometry runs in radians because the underlying trig functions demand it.
- Computed azimuths and angles come out in radians. The adjusted bearing between two control points might be 2.3562 rad.
- Export back to gon: 2.3562 × (200/π) = 150.0000 gon. This value goes into Leica GeoOffice or a DXF file for the CAD technician.
Skip step 4 and you hand the CAD team a bearing of 2.3562. They enter it as 2.3562 gon — an angle of about 2.12°. The property corner ends up in the wrong postcode.
How Many Decimal Places Do You Actually Need?
Surveying precision is measured in arc-seconds. One arc-second ≈ 0.000309 gon. Here's how decimal places in gradians map to field accuracy:
| Decimal places (gon) | Resolution | Equivalent at 100 m |
|---|---|---|
| 1 (e.g., 137.5) | 0.1 gon = 324″ | ±15.7 cm lateral |
| 2 (e.g., 137.46) | 0.01 gon = 32.4″ | ±1.57 cm |
| 4 (e.g., 137.4582) | 0.0001 gon = 0.324″ | ±0.016 mm |
| 6 (e.g., 137.458200) | 0.000001 gon = 0.003″ | sub-micron |
For typical boundary surveys, 4 decimal places in gradians (0.324 arc-second resolution) exceed what any field instrument can measure. Using Math.PI or math.pi gives you 15+ significant digits — far more precision than needed.
Six Worked Conversions for Common Bearings
These aren't textbook angles — they're bearings you'd actually encounter in survey computations:
0.7854 rad (45°): 0.7854 × 63.6620 = 50.0000 gon. Northeast diagonal. π/4 cancels to give an exact result.
1.2566 rad (72°): 1.2566 × 63.6620 ≈ 80.0000 gon. Interior angle of a regular pentagon. Clean in gon because 72° × 10/9 = 80.
2.3562 rad (135°): 2.3562 × 63.6620 ≈ 150.0000 gon. Southeast bearing off north. 3π/4 radians.
0.4363 rad (25°): 0.4363 × 63.6620 ≈ 27.7778 gon. A slope bearing on a hillside traverse. Note the repeating decimal — 25° doesn't land on a clean gradian value.
3.4034 rad (195°): 3.4034 × 63.6620 ≈ 216.6667 gon. A backsight bearing in the third quadrant.
5.5851 rad (320°): 5.5851 × 63.6620 ≈ 355.5556 gon. Northwest bearing close to north. In gradian-based compasses, this is near the 400/0 gon rollover point.
NATO Mils vs Gradians: Don't Confuse Them
Both divide a circle into more parts than degrees, but they're different systems. NATO mils split a circle into 6,400 parts. One gradian = 16 mils. The conversion factor from radians to NATO mils is 6400/(2π) ≈ 1,018.59 — completely different from the 200/π ≈ 63.66 factor for gradians.
To make it worse, Sweden historically used 6,300 mils per circle, and the Soviet system used 6,000. If someone says "convert radians to mils," always ask which mil system. For gradians (gon), there's only one standard: ISO 31-1 defines 400 gon per revolution.
One-Liner Implementations in Five Languages
# Python gon = rad * (200 / math.pi) // JavaScript / TypeScript const gon = rad * (200 / Math.PI); // C / C++ double gon = rad * (200.0 / M_PI); // C# (.NET) double gon = rad * (200.0 / Math.PI); // Rust let gon = rad * (200.0 / std::f64::consts::PI);
Always use the language's built-in π constant. Hard-coding 3.14159 loses 10 significant digits compared to Math.PI's 15-digit precision. Over a long traverse with dozens of angle computations, that truncation can accumulate to measurable error.
Need the reverse direction? Our radians to degrees converter is the more common conversion for general programming.
Trig Values in the Gradian System
The trig functions don't change — only the input labels. But seeing the gradian equivalents written out helps when you're debugging survey code:
- sin(50 gon) = sin(π/4) ≈ 0.7071 — the diagonal
- cos(100 gon) = cos(π/2) = 0 — the y-axis
- tan(50 gon) = tan(π/4) = 1 — slope of 1:1 (100% grade)
- sin(200 gon) = sin(π) = 0 — the negative x-axis
- cos(300 gon) = cos(3π/2) = 0 — straight down
The key insight: sin(100 gon) = 1, not sin(100°) which equals 0.9848. If you're testing code and expect sin(100) to return 1, you'd better be in gradian mode. In radian mode, sin(100) ≈ −0.5064 — a value that looks plausible enough to go unnoticed, which is exactly why unit confusion bugs are so dangerous.
For mapping and GPS work where angles start in degrees-minutes-seconds format, our DMS to decimal degrees converter handles the first step of the pipeline before you convert onward to radians or gradians.
