{
  "schemaVersion": 1,
  "slug": "room-layout-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "be89995d30a2e67a5f79abd6394859348b861e9dbdc1554b1d6fba3e1287dba6",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/room-layout-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": "g = k ÷ 12; U = max(0,(L - g)(W - g)); sofa = max(0,L - 2g)",
    "vars": [
      [
        "L",
        "Room length (ft)"
      ],
      [
        "W",
        "Room width (ft)"
      ],
      [
        "k",
        "Walkway clearance (in)"
      ],
      [
        "g",
        "Walkway clearance (ft)"
      ],
      [
        "U",
        "Usable furnished area (sq ft)"
      ]
    ],
    "note": "Usable area subtracts twice the clearance width from each room dimension. Furniture sizes are planning estimates."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const g=walkway/12; const area=length*width; const usableArea=Math.max(0,(length-2*g)*(width-2*g)); return{area,usableArea,maxSofa:Math.max(0,length-2*g),maxSeatShort:Math.max(0,width-2*g)};",
    "inputs": [
      {
        "name": "length",
        "type": "number",
        "default": 14,
        "min": 0,
        "max": 200,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "width",
        "type": "number",
        "default": 12,
        "min": 0,
        "max": 200,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "walkway",
        "type": "number",
        "default": 36,
        "min": 12,
        "max": 60,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "area",
        "precision": 1,
        "unit": "sq ft"
      },
      {
        "name": "usableArea",
        "precision": 1,
        "unit": "sq ft"
      },
      {
        "name": "maxSofa",
        "precision": 1,
        "unit": "ft"
      },
      {
        "name": "maxSeatShort",
        "precision": 1,
        "unit": "ft"
      }
    ],
    "interpret": null
  }
}
