Files
stgsharp/源代码/StgSharp/Math/Linear/Vector.GetLength.cs
T

24 lines
497 B
C#

namespace StgSharp.Math
{
public static unsafe partial class Vector
{
public static float GetLength(this vec3d vec)
{
return Scaler.Sqrt(
vec.X * vec.X +
vec.Y * vec.Y +
vec.Z * vec.Z
);
}
public static float GetLength(this Vec2d vec)
{
return Scaler.Sqrt(
vec.X * vec.X +
vec.Y * vec.Y
);
}
}
}