{
  "schemaVersion": 1,
  "slug": "angle-calculator",
  "category": "conversion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "02502d58846ff097d21e638846ab61db162a0be930fc4020b751f51a3bcfd2b1",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/angle-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "a₂ = a₁ × f₁ ÷ f₂",
    "vars": [
      [
        "a₂",
        "result angle"
      ],
      [
        "a₁",
        "input value"
      ],
      [
        "f₁",
        "source-unit factor expressed in degrees"
      ],
      [
        "f₂",
        "target-unit factor expressed in degrees"
      ]
    ],
    "note": "Factors: degree 1, radian 57.2958, gradian 0.9, turn 360, arcminute 1/60, arcsecond 1/3600; radians = degrees × π ÷ 180."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "NIST SP 811 — Conversion factors by quantity",
        "url": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9"
      }
    ],
    "basis": "Convert plane angle via degrees and radians; 180 degrees = π radians.",
    "limitations": "Only the displayed unit definitions are converted; rounding and measurement uncertainty are separate.",
    "implementationHash": "02502d58846ff097d21e638846ab61db162a0be930fc4020b751f51a3bcfd2b1",
    "domain": "conversion"
  },
  "contract": {
    "compute": "const units={\"deg\":\"°\",\"rad\":\"rad\",\"grad\":\"grad\",\"turn\":\"turn\",\"arcmin\":\"′\",\"arcsec\":\"″\"}, factors={\"deg\":1,\"rad\":57.29577951308232,\"grad\":0.9,\"turn\":360,\"arcmin\":0.016666666666666666,\"arcsec\":0.0002777777777777778}; if(!Number.isFinite(value)||value<-1000000000||value>1000000000||!Object.prototype.hasOwnProperty.call(units,from)||!Object.prototype.hasOwnProperty.call(units,to))return {\"result\":null,\"degrees\":null,\"radians\":null,\"gradians\":null,\"__error\":\"inputError\"}; const out=(function(){const F={deg:1,rad:57.29577951308232,grad:0.9,turn:360,arcmin:1/60,arcsec:1/3600}; const deg=value*F[from]; return { result: deg/F[to], degrees: deg, radians: deg*Math.PI/180, gradians: deg/0.9 };})(); if(out.__error)return {...{\"result\":null,\"degrees\":null,\"radians\":null,\"gradians\":null},...out}; out.__resultUnit=units[to]; out.__unitRatio=factors[to]/factors[from]; return out;",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 90,
        "min": -1000000000,
        "max": 1000000000,
        "step": 0.0001,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "from",
        "type": "select",
        "default": "deg",
        "options": [
          {
            "value": "deg"
          },
          {
            "value": "rad"
          },
          {
            "value": "grad"
          },
          {
            "value": "turn"
          },
          {
            "value": "arcmin"
          },
          {
            "value": "arcsec"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "rad",
        "options": [
          {
            "value": "rad"
          },
          {
            "value": "deg"
          },
          {
            "value": "grad"
          },
          {
            "value": "turn"
          },
          {
            "value": "arcmin"
          },
          {
            "value": "arcsec"
          }
        ]
      },
      {
        "name": "precision",
        "type": "select",
        "default": 4,
        "options": [
          {
            "value": 0
          },
          {
            "value": 2
          },
          {
            "value": 4
          },
          {
            "value": 6
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 4,
        "unit": "",
        "precisionField": "precision",
        "unitField": "__resultUnit",
        "trimTrailingZeros": true,
        "notation": "auto"
      },
      {
        "name": "degrees",
        "precision": 4,
        "unit": "°",
        "showWhen": {
          "to": [
            "rad",
            "grad",
            "turn",
            "arcmin",
            "arcsec"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "radians",
        "precision": 8,
        "unit": "rad",
        "showWhen": {
          "to": [
            "deg",
            "grad",
            "turn",
            "arcmin",
            "arcsec"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "gradians",
        "precision": 4,
        "unit": "grad",
        "showWhen": {
          "to": [
            "deg",
            "rad",
            "turn",
            "arcmin",
            "arcsec"
          ]
        },
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
