-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathVector.h
More file actions
40 lines (33 loc) · 869 Bytes
/
Copy pathVector.h
File metadata and controls
40 lines (33 loc) · 869 Bytes
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
#ifndef __VECTOR_IS_INCLUDED__
#define __VECTOR_IS_INCLUDED__
#define CO(V) V.x,V.y,V.z
struct Vector{
double x,y,z;
Vector();
Vector(double,double,double);
bool scan();
double mag2();
double mag();
void norm();
Vector unit();
void show();
void showln();
};
Vector operator+(Vector a,Vector b);
Vector operator-(Vector a);
Vector operator-(Vector a,Vector b);
Vector operator*(Vector a,Vector b);
Vector operator*(double a,Vector b);
Vector operator*(Vector b,double a);
Vector operator/(Vector b,double a);
double DOT(Vector a, Vector b);
Vector CROSS(Vector a, Vector b);
double BOX(Vector a, Vector b, Vector c);
double projectLength(Vector proj, Vector on);
Vector projectVector(Vector proj, Vector on);
Vector rotateVector(Vector rotatee, Vector axis, double angle);
extern Vector I;
extern Vector J;
extern Vector K;
extern Vector Origin;
#endif