如何预测未来的轨迹位置并根据当前飞机在开放层3中的速度和路线划出一条线?

问题描述 投票:0回答:1

我想绘制一个平面当前速度和航向的矢量线来预测其未来位置,每五分钟增加一个实心点。我不知道该怎么做。 look like this

line openlayers-3
1个回答
0
投票

这里给出了使用球面几何的公式https://www.movable-type.co.uk/scripts/latlong.html(椭球几何会稍微准确但更复杂)

var lat2 = Math.asin( Math.sin(lat1)*Math.cos(distance/radius) +
                    Math.cos(lat1)*Math.sin(distance/radius)*Math.cos(bearing) );
var lon2 = lon1 + Math.atan2(Math.sin(bearing)*Math.sin(distance/radius)*Math.cos(lat1),
                         Math.cos(distance/radius)-Math.sin(lat1)*Math.sin(lat2));

OpenLayers使用6371008.8米为地球的radius

distance将以time*speed的相同单位计算

© www.soinside.com 2019 - 2024. All rights reserved.