X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=math%2Fmath.h;fp=math%2Fmath.h;h=df8f6af28c785cc418a9efa1e86e199026bc0233;hb=710717c4033bc5b8eb34644914e762a2834ae345;hp=0000000000000000000000000000000000000000;hpb=6eb09b305eb6f565d844979b68dd2542e9a0d5fa;p=physik%2Fposic.git diff --git a/math/math.h b/math/math.h new file mode 100644 index 0000000..df8f6af --- /dev/null +++ b/math/math.h @@ -0,0 +1,29 @@ +/* + * math.h - basic vector calculations + * + * author: Frank Zirkelbach + * + */ + +#ifndef MATH_H +#define MATH_H + +/* datatypes */ + +typedef struct s_3dvec { + double x; + double y; + double z; +} t_3dvec; + +/* function prototypes */ + +int v3_add(t_3dvec *sum,t_3dvec *a,t_3dvec *b); +int v3_sub(t_3dvec *sum,t_3dvec *a,t_3dvec *b); +int v3_scale(t_3dvec *result,t_3dvec *a,double s); +int v3_zero(t_3dvec *vec); +int v3_set(t_3dvec *vec,double *ptr); +int v3_copy(t_3dvec *trg,t_3dvec *src); +int v3_cmp(t_3dvec *a,t_3dvec *b); + +#endif