diff options
-rw-r--r-- | src/spatial.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/spatial.c b/src/spatial.c index 98728df..f35749c 100644 --- a/src/spatial.c +++ b/src/spatial.c @@ -43,6 +43,28 @@ static int point_within_cone(xas_spatial_coord coord, return 1; } +static float dotf(float *sets, size_t count, size_t len) { + float ret = 0.0f; + + size_t x, y; + + if (count == 0 || len == 0) { + return 0.0f; + } + + for (x=0; x<count; x++) { + float num = sets[x*len+0]; + + for (y=1; y<len; y++) { + num *= sets[x*len+y]; + } + + ret += num; + } + + return ret; +} + static int buffer_realloc(xas_spatial_scene *scene, xas_spatial_buffer *buffer) { float seconds = scene->radius / scene->speed; |