From 415a98965a9d8ca1538e890367f27ec08c95f05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gael=20P=C3=A9rez?= Date: Wed, 20 Nov 2024 04:27:14 -0600 Subject: [PATCH] update raymath.h: add Vector2CrossProduct function (#4520) --- src/raymath.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/raymath.h b/src/raymath.h index e522113b..06865e19 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -304,6 +304,14 @@ RMAPI float Vector2DotProduct(Vector2 v1, Vector2 v2) return result; } +// Calculate two vectors cross product +RMAPI float Vector2CrossProduct(Vector2 v1, Vector2 v2) +{ + float result = (v1.x*v2.y - v1.y*v2.x); + + return result; +} + // Calculate distance between two vectors RMAPI float Vector2Distance(Vector2 v1, Vector2 v2) {