From 20f4d8c147993b85b1ad1fc1f0b069aca0339544 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 10 Dec 2021 11:41:45 +0100 Subject: [PATCH] Reviewed typo --- src/raymath.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 352c29e5c..97149625b 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -99,8 +99,7 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- #if !defined(RL_VECTOR2_TYPE) -// -type +// Vector2 type typedef struct Vector2 { float x; float y; @@ -534,10 +533,12 @@ RMAPI float Vector3Distance(Vector3 v1, Vector3 v2) // Calculate angle between two vectors RMAPI float Vector3Angle(Vector3 v1, Vector3 v2) { + float result = 0.0f; + Vector3 cross = { v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x }; float len = sqrtf(cross.x*cross.x + cross.y*cross.y + cross.z*cross.z); float dot = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z); - float result = atan2f(len, dot); + result = atan2f(len, dot); return result; }