{
  "schemaVersion": 1,
  "slug": "matrix-determinant-calculator",
  "category": "math",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "7b45e36149eda40e6d4dba0fe4f15aa196259d1231c3535193de53f01b31a785",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/matrix-determinant-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": "det = a(ei − fh) − b(di − fg) + c(dh − eg); tr = a + e + i",
    "vars": [
      [
        "det",
        "determinant of A"
      ],
      [
        "tr",
        "trace"
      ],
      [
        "A",
        "3×3 matrix [[a,b,c],[d,e,f],[g,h,i]]"
      ]
    ],
    "note": "Cofactor expansion along the first row. The matrix is singular when |det| < 1e-12."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const det = a*(e*i - f*h) - b*(d*i - f*g) + c*(d*h - e*g); return { determinant: det, trace: a+e+i, singular: Math.abs(det) < 1e-12 ? 'Yes' : 'No' };",
    "inputs": [
      {
        "name": "a",
        "type": "number",
        "default": 2,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "b",
        "type": "number",
        "default": 1,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "c",
        "type": "number",
        "default": 3,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "d",
        "type": "number",
        "default": 0,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "e",
        "type": "number",
        "default": 4,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "f",
        "type": "number",
        "default": 1,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "g",
        "type": "number",
        "default": 5,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "h",
        "type": "number",
        "default": 2,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      },
      {
        "name": "i",
        "type": "number",
        "default": 0,
        "min": -1000000,
        "max": 1000000,
        "step": 0.1
      }
    ],
    "outputs": [
      {
        "name": "determinant",
        "precision": 6,
        "unit": ""
      },
      {
        "name": "trace",
        "precision": 4,
        "unit": ""
      },
      {
        "name": "singular",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
