-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvec.h
More file actions
109 lines (73 loc) · 1.8 KB
/
Copy pathvec.h
File metadata and controls
109 lines (73 loc) · 1.8 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
108
109
template <int n>
struct doublen
{
double x[n];
};
template <int n>
double dot(doublen<n> x1, doublen<n> x2);
template <int n>
double norm(doublen<n> x1);
template <int n>
doublen<n> operator-(doublen<n> x1, doublen<n> x2);
template <int n>
doublen<n> operator+(doublen<n> x1, doublen<n> x2);
struct double2 {
double x, y;
};
struct float2 {
float x, y;
float2(float a, float b) :x(a), y(b) {
}
float2(double a, double b) :x(a), y(b) {
}
float2(double2 vertex) {
x = vertex.x;
y = vertex.y;
}
float2() {
}
};
float2 operator*(float s, float2 x);
float2 operator+(float2 x1, float2 x2);
double dot(double2 x1, double2 x2);
double norm(double2 x1);
float norm(float2 x1);
double vol(double2 x1, double2 x2);
double2 operator-(double2 x1, double2 x2);
double2 operator+(double2 x1, double2 x2);
double2 operator*(double s, double2 x);
double2 operator*(double2 x, double s);
double2 operator*(double2 a, double2 b);
double2 operator/(double2 a, double2 b);
struct double3 {
double x, y, z;
};
double dot(double3 x1, double3 x2);
double norm(double3 x1);
double vol(double3 x1, double3 x2, double3 x3);
double3 cross(double3 x1, double3 x2);
double3 operator-(double3 x1, double3 x2);
double3 operator+(double3 x1, double3 x2);
double3 operator*(double3 x, double s);
struct float3 {
float x, y, z;
float3(float a, float b, float c) :x(a),y(b),z(c){
}
float3(double a, double b, double c) :x(a), y(b), z(c) {
}
float3(double3 vertex) {
x = vertex.x;
y = vertex.y;
z = vertex.z;
}
float3() {
}
};
float dot(float3 x1, float3 x2);
float norm(float3 x1);
float vol(float3 x1, float3 x2, float3 x3);
float3 cross(float3 x1, float3 x2);
float3 operator-(float3 x1, float3 x2);
float3 operator+(float3 x1, float3 x2);
float3 operator*(float3 x, float s);
float3 operator*(float s, float3 x);