tests ...
[physik/posic.git] / math / math.h
1 /*
2  * math.h - basic vector calculations
3  *
4  * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
5  *
6  */
7
8 #ifndef MATH_H
9 #define MATH_H
10
11 /* datatypes */
12
13 typedef struct s_3dvec {
14         double x;
15         double y;
16         double z;
17 } t_3dvec;
18
19 /* function prototypes */
20
21 int v3_add(t_3dvec *sum,t_3dvec *a,t_3dvec *b);
22 int v3_sub(t_3dvec *sum,t_3dvec *a,t_3dvec *b);
23 int v3_scale(t_3dvec *result,t_3dvec *a,double s);
24 int v3_zero(t_3dvec *vec);
25 int v3_set(t_3dvec *vec,double *ptr);
26 int v3_copy(t_3dvec *trg,t_3dvec *src);
27 int v3_cmp(t_3dvec *a,t_3dvec *b);
28 double v3_scalar_product(t_3dvec *a,t_3dvec *b);
29 double v3_absolute_square(t_3dvec *a);
30 double v3_norm(t_3dvec *a);
31 int v3_per_bound(t_3dvec *a,t_3dvec *dim);
32
33 #endif