{
  "schemaVersion": 1,
  "slug": "electric-fence-calculator",
  "category": "construction",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "a1bd077b672cfccfaf5cff1329ba13f79a12294f27c9961d5eeaeba707a2fdbe",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/electric-fence-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": "W = P × S; N = ceil(P ÷ d) + 1; M = P ÷ 5280",
    "vars": [
      [
        "P",
        "fence perimeter (ft)"
      ],
      [
        "S",
        "wire strands"
      ],
      [
        "d",
        "post spacing (ft)"
      ],
      [
        "W",
        "total wire length (ft)"
      ],
      [
        "N",
        "estimated posts"
      ],
      [
        "M",
        "perimeter (miles)"
      ]
    ],
    "note": "Wire length = perimeter × strands; posts = ceil(perimeter ÷ post spacing) + 1; perimeter in miles = perimeter ÷ 5280. These outputs do not size an energizer; use manufacturer guidance and test the installed fence."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Gallagher — Electric fence planning and installation",
        "url": "https://search.am.gallagher.com/media/11511/gna_fence_manual.pdf"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "a1bd077b672cfccfaf5cff1329ba13f79a12294f27c9961d5eeaeba707a2fdbe",
    "basis": "W = P × S; N = ceil(P ÷ d) + 1; M = P ÷ 5280",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const wireFeet=perimeter*strands; const posts=Math.ceil(perimeter/postSpacingFt)+1; return {wireFeet,posts,fenceMiles:perimeter/5280};",
    "inputs": [
      {
        "name": "perimeter",
        "type": "number",
        "default": 800,
        "min": 10,
        "max": 50000,
        "step": 10,
        "slider": true
      },
      {
        "name": "strands",
        "type": "number",
        "default": 3,
        "min": 1,
        "max": 12,
        "step": 1,
        "slider": true
      },
      {
        "name": "postSpacingFt",
        "type": "number",
        "default": 12,
        "min": 4,
        "max": 60,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "wireFeet",
        "precision": 0,
        "unit": "ft"
      },
      {
        "name": "posts",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "fenceMiles",
        "precision": 3,
        "unit": "mi"
      }
    ],
    "interpret": null
  }
}
