You need to enable JavaScript to run this app. 高低潮位间时刻计算算法咨询:已实现潮高计算待修正时间逻辑
优惠活动
大模型
产品
解决方案
定价
更多

高低潮位间时刻计算算法咨询:已实现潮高计算待修正时间逻辑

潮汐计算与趋势可视化实现问题

我目前正在推进两项潮汐计算相关需求:

  • 计算高潮位与低潮位区间内任意时间点的潮高值
  • 根据给定潮高值,反推对应的精确发生时刻

目前任意时点的潮高计算逻辑已经调试正常,但给定潮高反推对应时刻的部分始终存在结果偏差。受限于三角函数相关知识储备不足,我拿不准这类计算对应的标准实现算法,因此想请教可靠的落地方案。

我已经基于Chart.js完成了潮汐趋势图表的开发,附上效果截图与完整前端实现代码:

潮汐趋势效果截图

document.addEventListener("DOMContentLoaded", () => {
  var chartData = {!! json_encode($predictions) !!}

  var ctx = document.getElementById("tideChart").getContext("2d");

  var myChart = new Chart(ctx, {
    type: 'line',
    data: {
      labels: [
        new Date("2020-10-18 04:20").toLocaleString(),
        new Date("2020-10-18 14:14").toLocaleString(),
        new Date("2020-10-19 04:53").toLocaleString(),
        new Date("2020-10-19 15:33").toLocaleString(),
        new Date("2020-10-20 05:37").toLocaleString(),
      ],
      datasets: [
        {
          label: 'Demo',
          data: [
            {
              t: new Date("2020-10-18 04:20"),
              y: 10.035,
            },
            {
              t: new Date("2020-10-18 14:14"),
              y: 8.517,
            },
            {
              t: new Date("2020-10-19 04:53"),
              y: 10.240,
            },
            {
              t: new Date("2020-10-19 15:33"),
              y: 8.394,
            },
            {
              t: new Date("2020-10-20 05:37"),
              y: 10.353,
            },
            {
              t: new Date("2020-10-20 16:57"),
              y: 8.342,
            }
          ],
          backgroundColor: [
            'rgba(255, 99, 132, 0.2)',
            'rgba(54, 162, 235, 0.2)',
            'rgba(255, 206, 86, 0.2)',
            'rgba(75, 192, 192, 0.2)',
            'rgba(153, 102, 255, 0.2)',
            'rgba(255, 159, 64, 0.2)'
          ],
          borderColor: [
            'rgba(255,99,132,1)',
            'rgba(54, 162, 235, 1)',
            'rgba(255, 206, 86, 1)',
            'rgba(75, 192, 192, 1)',
            'rgba(153, 102, 255, 1)',
            'rgba(255, 159, 64, 1)'
          ],
          borderWidth: 1
        },
        {
          label: 'Best',
          data: [
            {
              t: new Date("2020-10-18 18:39"),
              y: 9.3785,
            },
            {
              t: new Date("2020-10-19 04:53"),
              y: 10.240,
            },
          ],
          backgroundColor: [
            'rgba(100, 99, 132, 0.2)',
            'rgba(94, 162, 235, 0.2)',
            'rgba(123, 206, 86, 0.2)',
            'rgba(25, 192, 192, 0.2)',
            'rgba(113, 102, 255, 0.2)',
            'rgba(215, 159, 64, 0.2)'
          ],
          borderColor: [
            'rgba(255,99,132,1)',
            'rgba(54, 162, 235, 1)',
            'rgba(255, 206, 86, 1)',
            'rgba(75, 192, 192, 1)',
            'rgba(153, 102, 255, 1)',
            'rgba(255, 159, 64, 1)'
          ],
          borderWidth: 1
        }
      ]
    },
    options: {
      scales: {
        xAxes: [
          {
            type: 'time'
          }
        ]
      }
    }
  });
});

内容的提问来源于stack exchange,提问作者Logan Craft

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.21 12:54:04