{
  "schemaVersion": 1,
  "slug": "inseam-measurement-calculator",
  "category": "fashion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "4d598712dc1aad7a60da1488ba98a04cbead89beae16cec8299d0a135d4f2765",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/inseam-measurement-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": "I = h × r ; Icm = I × 2.54 ; L = round(I ÷ 2) × 2",
    "vars": [
      [
        "h",
        "height in inches (cm input ÷ 2.54)"
      ],
      [
        "r",
        "inseam ratio (short 0.42, regular 0.44, long 0.46)"
      ],
      [
        "I",
        "estimated inseam (in)"
      ]
    ],
    "note": "Pants length L is rounded to the nearest even inch; crotch height equals I."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const h = unit === 'cm' ? height/2.54 : height; const r = ratio === 'short' ? 0.42 : ratio === 'long' ? 0.46 : 0.44; const inseam = h*r; return { inseamIn: inseam, inseamCm: inseam*2.54, pantsLength: Math.round(inseam/2)*2 };",
    "inputs": [
      {
        "name": "height",
        "type": "number",
        "default": 68,
        "min": 40,
        "max": 100,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "unit",
        "type": "select",
        "default": "in",
        "options": [
          {
            "value": "in"
          },
          {
            "value": "cm"
          }
        ]
      },
      {
        "name": "ratio",
        "type": "select",
        "default": "average",
        "options": [
          {
            "value": "short"
          },
          {
            "value": "average"
          },
          {
            "value": "long"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "inseamIn",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "inseamCm",
        "precision": 1,
        "unit": "cm"
      },
      {
        "name": "pantsLength",
        "precision": 0,
        "unit": "in"
      }
    ],
    "interpret": null
  }
}
