From 7f24f37772871ad4a420f59f93b97ab1ad9b0e24 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 13 Apr 2010 00:21:52 +0200 Subject: digital/avr/modules/math/geometry: add normal and dot product --- digital/avr/modules/math/geometry/vect.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'digital/avr/modules/math/geometry/vect.h') diff --git a/digital/avr/modules/math/geometry/vect.h b/digital/avr/modules/math/geometry/vect.h index 6a1cc570..17fda6cb 100644 --- a/digital/avr/modules/math/geometry/vect.h +++ b/digital/avr/modules/math/geometry/vect.h @@ -83,6 +83,17 @@ vect_norm (const vect_t *v); void vect_from_polar_uf016 (vect_t *v, int16_t l, uint16_t a_uf016); +/** Compute a vector normal (rotate the vector counter-clockwise of pi/2). + * - v: input/result vector. */ +void +vect_normal (vect_t *v); + +/** Compute the dot product (scalar product) of two vectors. + * - a, b: vectors to make product of. + * - returns: dot product. */ +int32_t +vect_dot_product (const vect_t *a, const vect_t *b); + /** Scale (multiply) vectors by a fixed point value. * - va: input/result vectors array. * - vn: number of vectors. -- cgit v1.2.3