-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseGeometry.h
More file actions
executable file
·91 lines (73 loc) · 1.61 KB
/
Copy pathBaseGeometry.h
File metadata and controls
executable file
·91 lines (73 loc) · 1.61 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
* Copyright (C) 2016-01-25 Dasea <dhf0214@126.com>
*
* Description: 基本类型定义
*/
#ifndef __BASE_GEOMETRY_H__
#define __BASE_GEOMETRY_H__
#define LOG_TAG "kq_road"
//#define KQ_ROAD_DEBUG
#define INFO_OUT(...)
#define WARN_OUT(...)
#define ERROR_OUT(...)
#define DEBUG_OUT(...)
#ifndef NULL
#define NULL ((void*)0)
#endif
#define LINE_GAP (5)
#ifndef PI
#define PI (3.1415926535897)
#endif
// 偏角,固定为90度,即π/2
#define BORDER_ANGLE (PI/2)
//根据角度获得弧度
#define RADIAN(a) (a*PI/180.0)
//根据弧度获得角度
#define ANGLE(r) (180.0*r/PI)
// 左转
#define DIRECTION_TYPE_LEFT (-1)
// 不转
#define DIRECTION_TYPE_NO (0)
// 右转
#define DIRECTION_TYPE_RIGHT (1)
// 直线的最小长度,线元
#define LEASET_LINE_LEN (0.1)
struct Point3D {
Point3D() {
x=0;
y=0;
z=0;
azimuth = 0;
}
Point3D(double dx,double dy,double dz, double dazimuth=0) {
x=dx;
y=dy;
z=dz;
azimuth = dazimuth;
}
Point3D(const Point3D& point) {
x=point.x;
y=point.y;
z=point.z;
azimuth = point.azimuth;
}
Point3D& operator=(const Point3D& point) {
if (this == &point) return *this;
x = point.x;
y = point.y;
z = point.z;
azimuth = point.azimuth;
return *this;
}
bool operator==(const Point3D& Point)
{
if ((x-Point.x)<=0.00001&&(y-Point.y)<=0.00001)
return true;
return false;
}
double x;
double y;
double z;
double azimuth; // 方位角,弧度
};
#endif