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.

39 lines
1015 B
C++

#pragma once
/* 角度转化类,用于不同角度格式之间的相互转化 */
#include <iostream>
#include <string>
#include <vector>
#include <regex>
#include <locale>
#include <codecvt>
using namespace std;
class Angle
{
public:
Angle(void);
~Angle(void);
public:
void DegtoDms(double deg,int& d,int& m,double& s);
void DegtoRad(double deg,double& rad);
void DegtodDeg(double deg,int& d,double& m);
void DmstoDeg(int d,int m,double s,double& deg);
void DmstodDeg(int d,int m,double s,int& dDeg,double& dm);
string DoubleToString(double num,int precision=7);
string IntToString(int num);
//字符串分割函数
vector<string> split(string str, string pattern);
//vector<string> split(char* str,const char* d);
// convert string to wstring
std::wstring String2WString(const std::string &s);
// convert wstring to string
std::string WString2String(const std::wstring &ws);
// 经纬度转字符串度分秒
void getDMSString(double lon,double lat,string &str_lon,string &str_lat);
};