equal
deleted
inserted
replaced
|
1 #include "vector.h" |
|
2 |
|
3 int main() { |
|
4 Vector3 a(1, 2, 3); |
|
5 cout << "=== Vector3 test ===" << endl; |
|
6 cout << "a = " << a << endl; |
|
7 Vector3 b(2, 3, 2); |
|
8 cout << "b = " << b << endl; |
|
9 |
|
10 cout << "a + b = " << a + b << endl; |
|
11 cout << "b - a = " << b - a << endl; |
|
12 cout << "dot(a,b) = " << dot(a,b) << endl; |
|
13 cout << "cross(a,b) = " << cross(a,b) << endl; |
|
14 cout << "a * 2 = " << a * 2 << endl; |
|
15 cout << "3 * b = " << 3 * b << endl; |
|
16 cout << "-a = " << -a << endl; |
|
17 |
|
18 cout << "a.mag() = " << a.mag() << endl; |
|
19 cout << "a.unit() = " << a.unit() << endl; |
|
20 cout << "a.unit().mag() = " << a.unit().mag() << endl; |
|
21 |
|
22 return 0; |
|
23 } |