diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2018-10-02 00:53:07 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2018-10-02 00:53:07 -0700 |
commit | f9985ecbf681d9652642cb424c3ca49c2578a096 (patch) | |
tree | a5ab4c2ca1970d7439f76fb3d6f4aaabd9f733b1 | |
parent | b7be56cd9d90347daa59f007ef311f6fe92fae3a (diff) |
v2f: add scalar division
-rw-r--r-- | v2f.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -80,6 +80,20 @@ static inline v2f_t * pv2f_mult_scalar(const v2f_t *v, float scalar, v2f_t *res) } +static inline v2f_t v2f_div_scalar(const v2f_t *v, float scalar) +{ + return v2f_mult_scalar(v, 1.f / scalar); +} + + +static inline v2f_t * pv2f_div_scalar(const v2f_t *v, float scalar, v2f_t *res) +{ + *res = v2f_div_scalar(v, scalar); + + return res; +} + + static inline float v2f_dot(const v2f_t *a, const v2f_t *b) { return a->x * b->x + a->y * b->y; |