From: Jean-Philippe Bruyère Date: Thu, 9 Dec 2021 13:10:35 +0000 (+0100) Subject: vec2_dot X-Git-Tag: v0.2.0~37 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=62e114b2fb7996b6dbcb6ed8ccb60a76c0524566;p=jp%2Fvkvg.git vec2_dot --- diff --git a/src/vectors.h b/src/vectors.h index 6a29965..0886198 100644 --- a/src/vectors.h +++ b/src/vectors.h @@ -25,8 +25,8 @@ #include "vkvg_internal.h" typedef struct { - float x; - float y; + float x; + float y; }vec2; typedef struct { @@ -171,6 +171,9 @@ vkvg_inline bool vec2_isnan (vec2 v){ vkvg_inline bool vec2d_isnan (vec2d v){ return (bool)(isnan (v.x) || isnan (v.y)); } +vkvg_inline float vec2_dot (vec2 a, vec2 b) { + return (a.x * b.x) + (a.y * b.y); +} vkvg_inline bool vec4_equ (vec4 a, vec4 b){ return (EQUF(a.x,b.x)&EQUF(a.y,b.y)&EQUF(a.z,b.z)&EQUF(a.w,b.w));