mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-12 20:18:00 +01:00
maths: restore DotProduct function missing after e5cf17a1a6
This commit is contained in:
parent
98eaf73f8c
commit
fb7089b001
1 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,14 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue