函数
happyprograming
这个作者很懒,什么都没留下…
展开
-
弧度转角度
//弧度转角度double RADtoDMS(double RAD){ /*主函数: double RAD; cout << "弧度:"; cin >> RAD; RADtoDMS(RAD);*/ const double PI = 3.1415926535; double DMS; double d, m, s; d = int(RAD / PI * 180);//DD° m = int((RAD / PI * 180 - d) * 60);//MM″&l原创 2021-06-25 16:28:33 · 300 阅读 · 0 评论 -
二维动态数组-方阵
二维动态数组double row, col; double *column; double **array; cout << "矩阵阶数:";//这里默认矩阵是方阵 cin >> row; column = new double[row];//每行有几个数 array = new double*[row];//定义row个指针指向row个数组,每个指针指矩阵的每一行。 col = row; cout << "矩阵:" << endl; fo原创 2020-12-06 20:37:50 · 183 阅读 · 0 评论 -
坐标方位角
注意arctan算出的角度在各象限的情况,坐标系以x为竖轴,以y为横轴。顺时针象限为一,二,三,四。double azimuth(double x1, double y1, double x2, double y2)//坐标方位角{ //主函数: //double x1,y1,x2,y2; //cout << "坐标(x1,y1)(x2,y2)="; //cin >> x1 >> y1 >> x2 >> y2; //azimuth(x原创 2020-11-25 23:57:37 · 1274 阅读 · 2 评论 -
角度转弧度
角度转弧度要注意此函数输入的为50°45′30″-50.4530为直接变换,以60进一位。double DMStoRAD(double DMS)//角度转弧度{ //主函数: //double DMS; //cout << "角度:"; //cin >> DMS; //DMStoRAD(DMS); const double PI = 3.1415926535; double RAD; double d, m, s; d = int(DMS); m = in原创 2020-11-25 23:53:54 · 393 阅读 · 0 评论