Hacker News new | ask | show | jobs
by cbsks 500 days ago
There’s an algorithm you can use to calculate future tides but it’s complex and I wasn’t sure it would even run fast enough on the watch. I gave up after a few hours and ended up generating an array of high/low tide levels and times for the next few years. NOAA has all the tide data you could possibly want, and an api to grab it.

https://tidesandcurrents.noaa.gov/tide_predictions.html

https://api.tidesandcurrents.noaa.gov/api/prod/

3 comments

Casio do have a tide watch, which presumably uses that algorithm:

https://www.greatwatches.co.uk/collections/men/products/casi...

And this approach actually works for inland waters since NOAA predictions are accounting for geographic effects. (e.g. the tide in Seattle is drastically different in timing and magnitude from the Pacific Coast)
NOAA publishes the harmonic coefficients for each tide station, so if you hard code those constants into your program you should be able to generate accurate tide predictions. I looked into it a bunch before it started to feel less fun and more like “real work”.

https://tidesandcurrents.noaa.gov/about_harmonic_constituent...

Did you publish your simple solution anywhere?
Not yet. I’ll clean it up someday. But not today.
Looking forward! I hope to work on something similar soon too, the API solution seems helpful.