summaryrefslogtreecommitdiff
path: root/digital/avr/modules/math/geometry/vect.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/avr/modules/math/geometry/vect.c')
-rw-r--r--digital/avr/modules/math/geometry/vect.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/digital/avr/modules/math/geometry/vect.c b/digital/avr/modules/math/geometry/vect.c
index 57b5a4d4..88cc125f 100644
--- a/digital/avr/modules/math/geometry/vect.c
+++ b/digital/avr/modules/math/geometry/vect.c
@@ -84,6 +84,21 @@ vect_from_polar_uf016 (vect_t *v, int16_t l, uint16_t a_uf016)
}
void
+vect_normal (vect_t *v)
+{
+ assert (v);
+ int16_t tx = v->x, ty = v->y;
+ v->x = -ty;
+ v->y = tx;
+}
+
+int32_t
+vect_dot_product (const vect_t *a, const vect_t *b)
+{
+ return (int32_t) a->x * b->x + (int32_t) b->y * a->y;
+}
+
+void
vect_array_scale_f824 (vect_t *va, uint8_t vn, int32_t s_f824)
{
for (; vn; va++, vn--)