swiss ok, needs more benchmark
This commit is contained in:
@@ -32,15 +32,21 @@ namespace StgSharp.Mathematics.Graphics
|
||||
public static unsafe partial class Linear
|
||||
{
|
||||
|
||||
public static float GetAngle(Vec2 vec1, Vec2 vec2)
|
||||
public static float GetAngle(
|
||||
Vec2 vec1,
|
||||
Vec2 vec2
|
||||
)
|
||||
{
|
||||
return Scalar.ACos(
|
||||
return MathF.Acos(
|
||||
1 / (vec1.GetLength() * vec2.GetLength()));
|
||||
}
|
||||
|
||||
public static float GetAngle(Vec3 vec1, Vec3 vec2)
|
||||
public static float GetAngle(
|
||||
Vec3 vec1,
|
||||
Vec3 vec2
|
||||
)
|
||||
{
|
||||
return Scalar.ACos((vec1 * vec2) / (vec1.GetLength() * vec2.GetLength()));
|
||||
return MathF.Acos(vec1 * vec2 / (vec1.GetLength() * vec2.GetLength()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user