-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstdafx.cpp
More file actions
107 lines (101 loc) · 3.28 KB
/
stdafx.cpp
File metadata and controls
107 lines (101 loc) · 3.28 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include "stdafx.h"
Vector3 operator + (const Vector3 &a, const Vector3 &b) {
return Vector3(a.x + b.x, a.y + b.y, a.z + b.z);
}
Vector3 operator+(const Vector3 &a, double b) {
return Vector3(a.x + b, a.y + b, a.z + b);
}
Vector3 operator - (const Vector3 &a, const Vector3 &b) {
return Vector3(a.x - b.x, a.y - b.y, a.z - b.z);
}
Vector3 operator-(const Vector3 &a, double b) {
return Vector3(a.x - b, a.y - b, a.z - b);
}
Vector3 operator - (const Vector3 &a) {
return Vector3(-a.x, -a.y, -a.z);
}
Vector3 operator * (const Vector3 &a, const double b) {
return Vector3(a.x * b, a.y * b, a.z * b);
}
Vector3 operator * (const double b, const Vector3 &vec) {
return Vector3(vec.x * b, vec.y * b, vec.z * b);
}
Vector3 operator * (const Vector3 &a, const Vector3 &b) {
return Vector3(a.x * b.x, a.y * b.y, a.z * b.z);
}
Vector3 operator / (const Vector3 &vec, const double b) {
return Vector3(vec.x / b, vec.y / b, vec.z / b);
}
Vector3 operator += (Vector3 &vec1, const Vector3 &vec2) {
return Vector3(vec1 = vec1 + vec2);
}
Vector3 operator -= (Vector3 &vec1, const Vector3 &vec2) {
return Vector3(vec1 = vec1 - vec2);
}
Vector3 operator *= (Vector3 &vec, const double b) {
return Vector3(vec = vec * b);
}
Vector3 operator /= (Vector3 &vec, const double b) {
return Vector3(vec = vec / b);
}
::Vector3 Vector3::operator-() {
return Vector3(-this->x, -this->y, -this->z);
}
double & Vector3::operator[](int pos) {
switch (pos) {
case 0: return x;
case 1: return y;
case 2: return z;
default: return x;
}
}
platf_angl operator + (const platf_angl &a, const platf_angl &b) {
return platf_angl(a.kappa + b.kappa, a.chi + b.chi, a.psi + b.psi);
}
platf_angl operator - (const platf_angl &a, const platf_angl &b) {
return platf_angl(a.kappa - b.kappa, a.chi - b.chi, a.psi - b.psi);
}
platf_angl operator*(double b, const platf_angl &vec) {
return platf_angl(vec.kappa * b, vec.chi * b, vec.psi * b);
}
platf_angl operator*(const platf_angl &vec, double b) {
return platf_angl(vec.kappa * b, vec.chi * b, vec.psi * b);
}
platf_angl operator/(const platf_angl &vec, double b) {
return platf_angl(vec.kappa / b, vec.chi / b, vec.psi / b);
}
platf_angl operator+=(platf_angl &vec1, const platf_angl &vec2) {
return platf_angl(vec1 = vec1 + vec2);
}
platform operator+(const platform &a, const platform &b) {
return platform(a.pos + b.pos, a.ang + b.ang);
}
platform operator-(const platform &a, const platform &b) {
return platform(a.pos - b.pos, a.ang - b.ang);
}
platform operator += (platform &vec1, const platform &vec2) {
return platform(vec1 = vec1 + vec2);
}
platform operator/(const platform &a, double b) {
return platform(a.pos / b, a.ang / b);
}
double & platf_angl::operator[](int pos) {
switch (pos) {
case 0: return kappa;
case 1: return chi;
case 2: return psi;
default: return kappa;
}
}
engine_position operator+(const engine_position &a, double b) {
return engine_position(a.x + b, a.y + b, a.z + b);
}
::engine_position engine_position::operator-() {
return engine_position(-this->x, -this->y, -this->z);
}
engine_position operator / (const engine_position &vec, const double b) {
return engine_position(vec.x / b, vec.y / b, vec.z / b);
}
engine_position operator * (const engine_position &a, const double b) {
return engine_position(a.x * b, a.y * b, a.z * b);
}