mirror of
https://github.com/ENSL/NS.git
synced 2024-12-11 05:11:27 +00:00
10 lines
427 B
C
10 lines
427 B
C
|
#ifndef VECOP_H
|
||
|
#define VECOP_H
|
||
|
|
||
|
#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
|
||
|
#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];}
|
||
|
#define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];}
|
||
|
#define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];}
|
||
|
#define VectorClear(a) { a[0]=0.0;a[1]=0.0;a[2]=0.0;}
|
||
|
|
||
|
#endif
|