Estimates the tide height at a query time between a known high and low tide using the traditional rule-of-twelfths approximation.
Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.
Try it
Inputs
start_time_hours (number, hours, required) : Time of the first known tide (high or low), in decimal hours on any consistent timeline.
start_height (number, same unit as end_height, required) : Tide height at start_time_hours.
end_time_hours (number, hours, required) : Time of the next tide (the opposite of start), in decimal hours. Should be about 6 hours after start_time_hours.
end_height (number, same unit as start_height, required) : Tide height at end_time_hours.
query_time_hours (number, hours, required) : Time at which to estimate the height, between start_time_hours and end_time_hours.
Outputs
estimated_height (same unit as inputs): 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.
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
cumulative_twelfths_by_hour = [0,1,3,6,9,11,12] twelfths of range (source)
Sources
Tides & Currents (NOAA Center for Operational Oceanographic Products and Services (CO-OPS), 2026-09-30T22:29:13Z) - Confirmed live: NOAA's authoritative tide prediction portal. The rule of twelfths itself is a longstanding navigational approximation (not a NOAA method); this card cites NOAA CO-OPS as the source of real, non-approximated tide predictions referenced in the steps above.