From fb7089b0014df940a0fab6db4aeac3de18007c8c Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Wed, 18 Jul 2018 01:57:31 +0200 Subject: [PATCH] maths: restore DotProduct function missing after e5cf17a1a68ceea1c67675d4351ba4b8b547e756 --- src/maths.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/maths.c b/src/maths.c index 8ced41f..180de95 100644 --- a/src/maths.c +++ b/src/maths.c @@ -27,6 +27,14 @@ #include #include +SYMBOL_EXPORT double DotProduct(const double v[], const double u[], int n) { + float result = 0.0; + for (int i = 0; i < n; i++) { + result += v[i] * u[i]; + } + return result; +} + SYMBOL_EXPORT double VectorLength(double x, double y, double z) { return sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2)); }