You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
644 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include <vector>
#include <cmath>
using namespace std;
#define PI 3.14159265358979323846
class GeoCompute
{
public:
GeoCompute(void);
~GeoCompute(void);
/*@brief 根据起点坐标、方位角、距离,计算另一点坐标。
* 使用Vincenty's公式求解,使用WGS-84椭球
* startPoint:起始点地理坐标点lat(-90到90)lon(-180,180)
* bearing:方位角(度)
* dist:两点之间距离(km)
*/
void computeOffsetGeoPosition(double lon1, double lat1, double bearing, double dist,double& targetLon,double& targetLat);
// 使用Vincenty's公式计算地理距离(m)
double VincentyDistance(double lon1, double lat1, double lon2, double lat2);
};