主要内容

本页采用了机器翻译。点击此处可查看英文原文。

gcwaypts

沿大圆等间距分布的航点

语法

[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2)
[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2,nlegs)
pts = gcwaypts(lat1,lon1,lat2,lon2...)

说明

[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2) 返回连接两个端点 (lat1,lon1) 和 (lat2,lon2) 的大圆路径上等间隔点的坐标。

[lat,lon] = gcwaypts(lat1,lon1,lat2,lon2,nlegs) 指定要计算的等长轨迹段数量。返回 nlegs+1 个输出点,因为需要一个最终端点。默认腿数为 10。

pts = gcwaypts(lat1,lon1,lat2,lon2...) 将输出(原本是两个两列向量)打包成形式为 [latitude longitude] 的两列矩阵。本指南中,航行轨迹上连续航点的格式称为航迹格式。有关更多信息,请参阅本节中的 navigational track format 参考页面。

背景

这是一个入航海导航函数。它假定所有纬度和经度单位均为度。

在航行实践中,大圆航线常被近似为恒向线线段。这样做是为了在无需频繁改变航向的情况下,尽可能接近点与点之间的最短距离。gcwaypts 函数提供了一种便捷方式,用于沿大圆航线查找航点,这些航点可作为恒向线段(轨迹段)的端点。

示例

全部折叠

假设您拥有一艘帆船游艇,计划从巴巴多斯北角(北纬 13.33°,西经 59.62°)启航,前往法国布雷斯特(北纬 48.36°,西经 4.49°)。将轨迹分为三个等长的段落。

figure('color','w');
ha = axesm('mapproj','mercator',...
    'maplatlim',[10 55],'maplonlim',[-80 10],...
    'MLineLocation',15,'PLineLocation',15);
axis off, gridm on, framem on;
% Load coastline data and plot it in the figure.
load coastlines;
hg = geoshow(coastlat,coastlon,'displaytype','line','color','b');
% Define point locations for Barbados and Brest
barbados = [13.33 -59.62];
brest = [48.36 -4.49];
% Calculate the waypoints along the path.
[l,g] = gcwaypts(barbados(1),barbados(2),brest(1),brest(2),3);
geoshow(l,g,'displaytype','line','color','r',...
    'markeredgecolor','r','markerfacecolor','r','marker','o');
geoshow(barbados(1),barbados(2),'DisplayType','point',...
    'markeredgecolor','k','markerfacecolor','k','marker','o')
geoshow(brest(1),brest(2),'DisplayType','point',...
    'markeredgecolor','k','markerfacecolor','k','marker','o')

Figure contains an axes object. The hidden axes object contains 7 objects of type patch, line. One or more of the lines displays its values using only markers

版本历史记录

在 R2006a 之前推出

另请参阅

| | |