{
  "address": "40dc45ca1286d07c8200f3fbd0b8f859",
  "category": "other",
  "question": "Using the rule of twelfths, if the tide is 4 at hour 0 and 1 at hour 6, what is the estimated height at hour 2?",
  "answer": "3.25",
  "askedBy": {
    "kind": "guest",
    "display": "method deck",
    "stamped": false,
    "id": null
  },
  "answeredBy": "method",
  "madeAt": "2026-09-30T22:39:30.722Z",
  "validUntil": null,
  "validityClass": "forever",
  "sources": [
    {
      "label": "Tides & Currents",
      "url": "https://tidesandcurrents.noaa.gov/"
    }
  ],
  "supersedes": null,
  "supersededBy": null,
  "isSeed": false,
  "seedSource": null,
  "seedAttribution": null,
  "duplicateOfQid": null,
  "publishedAt": null,
  "unpublishedAt": null,
  "voteCount": 0,
  "queuedForSubstrate": false,
  "answerMethod": "method",
  "unsourced": false,
  "source": {
    "kind": "url",
    "value": "https://tidesandcurrents.noaa.gov/",
    "retrieved_utc": "2026-09-30T22:29:13Z"
  },
  "qsha256": "8226a6ae459ad8743a03d67e9ea797e44e7e9924c0b841644e9f3cc07a54d22b",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Tide height by the rule of twelfths",
    "version": "1",
    "source_url_or_file": "methods/tide-height-rule-of-twelfths.cjs",
    "sha256_of_method_file": "243f8e9073917f361579c536a641327eea419e04520918908a96afeea1f4d09f"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "start_time_hours",
        "type": "number",
        "unit": "hours",
        "required": true,
        "description": "Time of the first known tide (high or low), in decimal hours on any consistent timeline."
      },
      {
        "name": "start_height",
        "type": "number",
        "unit": "same unit as end_height",
        "required": true,
        "description": "Tide height at start_time_hours."
      },
      {
        "name": "end_time_hours",
        "type": "number",
        "unit": "hours",
        "required": true,
        "description": "Time of the next tide (the opposite of start), in decimal hours. Should be about 6 hours after start_time_hours."
      },
      {
        "name": "end_height",
        "type": "number",
        "unit": "same unit as start_height",
        "required": true,
        "description": "Tide height at end_time_hours."
      },
      {
        "name": "query_time_hours",
        "type": "number",
        "unit": "hours",
        "required": true,
        "description": "Time at which to estimate the height, between start_time_hours and end_time_hours."
      }
    ],
    "outputs": [
      {
        "name": "estimated_height",
        "unit": "same unit as inputs",
        "description": "Estimated tide height at the query time."
      }
    ],
    "steps": [
      "The rule of twelfths splits the roughly 6-hour rise or fall between a high and a low tide into 6 hourly amounts of 1, 2, 3, 3, 2, and 1 twelfths of the total range, in order.",
      "Cumulative twelfths at hour marks 0 through 6 are therefore 0, 1, 3, 6, 9, 11, and 12.",
      "Scale the elapsed time between start_time_hours and query_time_hours onto a canonical 0-to-6-hour timeline (elapsed / actual duration * 6), since the real interval may not be exactly 6 hours.",
      "Within the hour that contains the scaled elapsed time, linearly interpolate between that hour's cumulative twelfths and the next hour's cumulative twelfths.",
      "estimated_height = start_height + (end_height - start_height) * (interpolated cumulative twelfths / 12).",
      "Round the result to 2 decimals.",
      "This is a classroom approximation only. Real tide predictions come from NOAA CO-OPS (https://tidesandcurrents.noaa.gov/) and account for the actual, non-uniform tidal curve and the true semidiurnal period (about 6 hours 12.5 minutes, not exactly 6 hours)."
    ],
    "constants": [
      {
        "name": "cumulative_twelfths_by_hour",
        "value": "[0,1,3,6,9,11,12]",
        "unit": "twelfths of range",
        "source": 0
      }
    ],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "start_time_hours": 0,
          "start_height": 4,
          "end_time_hours": 6,
          "end_height": 1,
          "query_time_hours": 2
        },
        "expected": {
          "answer": "3.25"
        },
        "check": "By hand: hour 2 falls exactly at the hour-2 mark, cumulative twelfths = 1+2 = 3 of 12, so 3/12 of the 3.0 m range (0.75 m) has fallen from the 4.0 m high: 4.0 - 0.75 = 3.25 m."
      },
      {
        "name": "test vector: rising tide, midpoint of hour 5",
        "inputs": {
          "start_time_hours": 0,
          "start_height": 0.5,
          "end_time_hours": 6,
          "end_height": 5,
          "query_time_hours": 4.5
        },
        "expected": {
          "answer": "4.25"
        },
        "check": "By hand: hour 4 mark is 9/12 and hour 5 mark is 11/12; the midpoint of hour 5 (query at 4.5h) interpolates to 10/12 of the 4.5 m range (3.75 m) above the 0.5 m low: 0.5 + 3.75 = 4.25 m."
      }
    ],
    "disclaimer": null,
    "deck_category": "astronomy"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "url",
          "value": "https://tidesandcurrents.noaa.gov/",
          "retrieved_utc": "2026-09-30T22:29:13Z"
        },
        "sha256": "08ff8233a0de60c0c8324a8b34a23f3a97ab27c6cac0ebc41843f0393ef66792",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Tide height by the rule of twelfths",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
