{
  "schemaVersion": 1,
  "slug": "hammock-hang-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "4cd0139bde4bc71d1bcf170a451f12e9c26f09d85e8062361fa4908a78e46754",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/hammock-hang-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 ÷ 2) × tan θ + S ÷ 12",
    "vars": [
      [
        "D",
        "Distance between anchors, ft"
      ],
      [
        "θ",
        "Hang angle from horizontal, degrees"
      ],
      [
        "S",
        "Seat height above ground, in"
      ],
      [
        "H",
        "Approximate anchor height, ft"
      ]
    ],
    "note": "The model assumes level ground and equal anchor heights; sag at each end is (D ÷ 2) × tan θ. Comfortable hang angle is commonly around 25–35°; ridgeline ≈ 0.83 × hammock length."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const r = hangAngle*Math.PI/180; const anchorHeight = distance*Math.tan(r)/2+sitHeight/12; return { anchorHeight, ridgeline: hammockLength*0.83, sag: distance*Math.tan(r)*12/2, angleNote: hangAngle >= 25 && hangAngle <= 35 ? 'Angle is in the comfortable 25-35° range' : 'Outside the usual 25-35° range, expect a tighter or sagging feel' };",
    "inputs": [
      {
        "name": "hammockLength",
        "type": "number",
        "default": 10,
        "min": 4,
        "max": 20,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "hangAngle",
        "type": "number",
        "default": 30,
        "min": 15,
        "max": 45,
        "step": 1,
        "slider": true
      },
      {
        "name": "sitHeight",
        "type": "number",
        "default": 18,
        "min": 6,
        "max": 36,
        "step": 1,
        "slider": true
      },
      {
        "name": "distance",
        "type": "number",
        "default": 14,
        "min": 4,
        "max": 40,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "anchorHeight",
        "precision": 2,
        "unit": "ft"
      },
      {
        "name": "ridgeline",
        "precision": 2,
        "unit": "ft"
      },
      {
        "name": "sag",
        "precision": 1,
        "unit": "in"
      },
      {
        "name": "angleNote",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
