船舶航向计算

这段代码用于计算船舶从一点到另一点的航向角度,基于笛卡尔坐标系和所需航行的角度。它不考虑帆船的横风调整,仅提供两点间直线航向。
摘要由CSDN通过智能技术生成
参考网址http://rebelengineering.blogspot.com/
Here is some of our code- this section is a compound if function written last night that determines the course angle based on the cartesian plane and the angle in degrees that the boat needs to travel.

{
   if((myLat- wp1Lat) < 0) //Top hemispehere
       {
       if((myLong - wp1Long) < 0) //Left Hemishpere
       {float course = 180 - angle;}
      
       else  //Right hemishpere
       {course = angle;}
       }
   else // Lower hemisphere
      {
      if((myLong - wp1Long) > 0) //Left Hemishpere
      {course = 180 + angle;}
     
      else  //Right hemishpere
      {course = 180 - angle;}
     
      Serial.print("        course:       ");
      Serial.print(course,4);
      }
}

This is the final code that calculates the course of the boat. This does NOT include tacking, only the actual angle course from point
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值