⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 angle.h

📁 用 c++编写的GPS水准拟合的程序
💻 H
字号:
#include "math.h"
#include "iostream.h"
#define PI 3.141592653589793
#include "iomanip.h"

double dtor(double a)//the angle from degree、minitue and second to radian 
{
	double r=0.0;
	int d=0,m=0;double s=0.0;
	a=a*10000.0;
	d=(int)(a/10000);//cout<<"d="<<d<<endl;
	m=(int)((a-d*10000.0)/100.0);
	if(m>=60)  cout<<"input error!\n";//cout<<"m="<<m<<endl;
    s=a-d*10000.0-m*100.0;
	if(s>=60)  cout<<"input error!\n";//cout<<"s="<<s<<endl;
	r=d+m/60.0+s/3600.0; //cout<<"it is"<<r<<" degree"<<endl;
	r=r*PI/180.0;
	return r;
}

double rtod(double r)//the angle from radia to degree、minitue and second
{
	double a=r*180.0/PI,s=0.0,s0=0.0;
	int d=0,m=0;
	s0=a*3600.0;
	d=int(s0/3600.0);//cout<<"\n d=" <<d<<endl;
	m=(int)((s0-d*3600)/60.0);//cout<<"\n m=" <<m<<endl;
	s=s0-d*3600-m*60.0;//cout<<"\n s=" <<s<<endl;
	double g=d+m/100.0+s/10000.0;
	return g;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -