fix: Speedy predictions

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2026-04-03 16:09:31 +00:00
parent a0489c459c
commit 5aa16c3052
10 changed files with 403 additions and 75 deletions
+11
View File
@@ -158,3 +158,14 @@ export const vectorNormalize = (v: Vector): Vector => {
* Calculate the right-hand normal of the vector.
*/
export const vectorNormal = (v: Vector): Vector => vector(v[1], -v[0]);
/**
* Scalar projection of vector v onto normal.
*
* @param v
* @param normal
* @returns
*/
export const vectorReflect = (v: Vector, normal: Vector): Vector => {
return vectorSubtract(v, vectorScale(normal, 2 * vectorDot(v, normal)));
};