-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMathFunction.h
More file actions
executable file
·49 lines (39 loc) · 1.84 KB
/
Copy pathMathFunction.h
File metadata and controls
executable file
·49 lines (39 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __MATH_FUNCTION_H__
#define __MATH_FUNCTION_H__
#include "BaseGeometry.h"
#include <cmath>
#include <string>
// 共用函数类(interface)
class MathFunction {
public:
MathFunction();
~MathFunction();
public:
static double GetTwoPointLength(const Point3D& startPt, const Point3D& endPt);
//计算线段的角度,通过第一,二想先弧度可以0到PI,如果在第三,四象限,弧度可以0到-PI
static double GetLineAngle(const Point3D& startPt, const Point3D& endPt);
// 根据三个点求圆心
static Point3D GetCircleCenter(const Point3D& startPt, const Point3D& middlePt, const Point3D& endPt);
//弧度转换为度
static double ConvertRadianToDegree(const double& dRadian){return ANGLE(dRadian);};
//角度转换为弧度
static double ConVertDegreeToRadian(const double& dDegree){return RADIAN(dDegree);};
//计算两条线之间的夹角
static double GetTwoLineAngle(const Point3D& startPt,const Point3D& middlePt,const Point3D& endPt);
// 计算缓和曲线的内移值
static double GetCurveP(const double& dCurveLengthOne, const double& dCircleRadioLength);
//计算缓和曲线的切线增量
static double GetCurveM(const double& dCurveLengthOne, const double& dCircleRadioLength);
// 计算偏向
static double ComputerDirection(Point3D& aPt, Point3D& bPt, Point3D& cPt);
static double ComputerDirection(double angleOne, double angleTwo);
// 度分秒与du的互相转换
static double ConvertDMSToD(const std::string& strDMS);
static double DmsToDegree(double V); // 度.分秒->度
static double DegreeToDms(double V); // 度->度.分秒 ddd.mmss
// 提取一个数的正负号
static int Sgn(double num);
// 方位角的值的判断(0 - 360)
static double JudgeAzimuth(double azimuth);
};
#endif /* __MATH_FUNCTION_H__ */