{
  "schemaVersion": 1,
  "slug": "desk-height-calculator",
  "category": "productivity",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "4ee59e289df5477c0282792b750c55cee84ed862ab69be0a79a455771a41282d",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/desk-height-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": "h_d = k H + s; h_m = 0.94H + s",
    "vars": [
      [
        "H",
        "Body height (in)"
      ],
      [
        "k",
        "Elbow ratio (0.40–0.41)"
      ],
      [
        "s",
        "Footwear (in)"
      ],
      [
        "h_d",
        "Desk height (in)"
      ],
      [
        "h_m",
        "Monitor height (in)"
      ]
    ],
    "note": "k = 0.41 keyboard, 0.40 writing, 0.405 mixed work; cm = 2.54×h_d."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const h=Number(elbowHeight);if(!Number.isFinite(h)||h<15||h>45)return{deskHeight:null,deskHeightCm:null,keyboardHeight:null,note:null,__error:'inputError'};return{deskHeight:h,deskHeightCm:h*2.54,keyboardHeight:h,note:workType==='writing'?'Adjust the surface for handwriting comfort while keeping shoulders relaxed':'Keep shoulders relaxed and wrists straight; adjust the chair or keyboard tray if needed'};",
    "inputs": [
      {
        "name": "elbowHeight",
        "type": "number",
        "default": 27,
        "min": 15,
        "max": 45,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "workType",
        "type": "select",
        "default": "keyboard",
        "options": [
          {
            "value": "keyboard"
          },
          {
            "value": "writing"
          },
          {
            "value": "mixed"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "deskHeight",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "deskHeightCm",
        "precision": 1,
        "unit": "cm"
      },
      {
        "name": "keyboardHeight",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
