mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-07 20:08:14 +00:00
Update raymath.h (#1118)
* Update raymath.h Added Vector2Rotate Function. * Update raymath.h
This commit is contained in:
@@ -268,6 +268,14 @@ RMDEF Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Rotate Vector by float in Degrees.
|
||||
RMDEF Vector2 Vector2Rotate(Vector2 v, float degs)
|
||||
{
|
||||
float rads = degs*DEG2RAD;
|
||||
Vector2 result = {v.x * cosf(rads) - v.y * sinf(rads) , v.x * sinf(rads) + v.y * cosf(rads) };
|
||||
return result;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module Functions Definition - Vector3 math
|
||||
//----------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user