X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=math%2Fmath.c;h=54d79fd9cf20533e1867e5933728ac4528021670;hb=000e702c884e337f27ae66b6506ff9f9b613f8a8;hp=6f4345e0124460ebbcb63a0482df9e367e592629;hpb=a9fbc66448c52bc4138176739b33d17ba86b7eae;p=physik%2Fposic.git diff --git a/math/math.c b/math/math.c index 6f4345e..54d79fd 100644 --- a/math/math.c +++ b/math/math.c @@ -66,6 +66,11 @@ int v3_cmp(t_3dvec *a,t_3dvec *b) { return(memcmp(a,b,sizeof(t_3dvec))); } +double v3_scalar_product(t_3dvec *a,t_3dvec *b) { + + return(a->x*b->x+a->y*b->y+a->z*b->z); +} + double v3_absolute_square(t_3dvec *a) { return(a->x*a->x+a->y*a->y+a->z*a->z);