Исправление: замена табуляций на пробелы

This commit is contained in:
Andrey Pokidov 2024-11-20 13:32:50 +07:00
parent ebb0a73555
commit aafe4e9075
4 changed files with 80 additions and 80 deletions

View file

@ -193,33 +193,33 @@ namespace BGC
public static float GetAngle(in FP32Vector2 vector1, in FP32Vector2 vector2, AngleUnit unit)
{
float squareModule1 = vector1.GetSquareModule();
float squareModule1 = vector1.GetSquareModule();
if (squareModule1 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
float squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
float cosine = FP32Vector2.GetScalarProduct(vector1, vector2) / MathF.Sqrt(squareModule1 * squareModule2);
if (1.0f - FP32Utility.EPSYLON <= cosine)
if (squareModule1 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
}
if (cosine <= -(1.0f - FP32Utility.EPSYLON))
float squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
float cosine = FP32Vector2.GetScalarProduct(vector1, vector2) / MathF.Sqrt(squareModule1 * squareModule2);
if (1.0f - FP32Utility.EPSYLON <= cosine)
{
return 0.0f;
}
if (cosine <= -(1.0f - FP32Utility.EPSYLON))
{
return FP32Angle.GetHalfCircle(unit);
}
}
return FP32Radians.ToUnits(MathF.Acos(cosine), unit);
return FP32Radians.ToUnits(MathF.Acos(cosine), unit);
}
public static float GetSquareDistance(in FP32Vector2 vector1, in FP32Vector2 vector2)

View file

@ -236,33 +236,33 @@ namespace BGC
public static float GetAngle(in FP32Vector3 vector1, in FP32Vector3 vector2, AngleUnit unit)
{
float squareModule1 = vector1.GetSquareModule();
float squareModule1 = vector1.GetSquareModule();
if (squareModule1 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
float squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
float cosine = FP32Vector3.GetScalarProduct(vector1, vector2) / MathF.Sqrt(squareModule1 * squareModule2);
if (1.0f - FP32Utility.EPSYLON <= cosine)
if (squareModule1 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
}
if (cosine <= -(1.0f - FP32Utility.EPSYLON))
float squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP32Utility.SQUARE_EPSYLON)
{
return 0.0f;
}
float cosine = FP32Vector3.GetScalarProduct(vector1, vector2) / MathF.Sqrt(squareModule1 * squareModule2);
if (1.0f - FP32Utility.EPSYLON <= cosine)
{
return 0.0f;
}
if (cosine <= -(1.0f - FP32Utility.EPSYLON))
{
return FP32Angle.GetHalfCircle(unit);
}
}
return FP32Radians.ToUnits(MathF.Acos(cosine), unit);
return FP32Radians.ToUnits(MathF.Acos(cosine), unit);
}
public static float GetSquareDistance(in FP32Vector3 vector1, in FP32Vector3 vector2)

View file

@ -193,33 +193,33 @@ namespace BGC
public static double GetAngle(in FP64Vector2 vector1, in FP64Vector2 vector2, AngleUnit unit)
{
double squareModule1 = vector1.GetSquareModule();
double squareModule1 = vector1.GetSquareModule();
if (squareModule1 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
double squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
double cosine = FP64Vector2.GetScalarProduct(vector1, vector2) / Math.Sqrt(squareModule1 * squareModule2);
if (1.0 - FP64Utility.EPSYLON <= cosine)
if (squareModule1 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
}
if (cosine <= -(1.0 - FP64Utility.EPSYLON))
double squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
double cosine = FP64Vector2.GetScalarProduct(vector1, vector2) / Math.Sqrt(squareModule1 * squareModule2);
if (1.0 - FP64Utility.EPSYLON <= cosine)
{
return 0.0;
}
if (cosine <= -(1.0 - FP64Utility.EPSYLON))
{
return FP64Angle.GetHalfCircle(unit);
}
}
return FP64Radians.ToUnits(Math.Acos(cosine), unit);
return FP64Radians.ToUnits(Math.Acos(cosine), unit);
}
public static double GetSquareDistance(in FP64Vector2 vector1, in FP64Vector2 vector2)

View file

@ -236,33 +236,33 @@ namespace BGC
public static double GetAngle(in FP64Vector3 vector1, in FP64Vector3 vector2, AngleUnit unit)
{
double squareModule1 = vector1.GetSquareModule();
double squareModule1 = vector1.GetSquareModule();
if (squareModule1 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
double squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
double cosine = FP64Vector3.GetScalarProduct(vector1, vector2) / Math.Sqrt(squareModule1 * squareModule2);
if (1.0 - FP64Utility.EPSYLON <= cosine)
if (squareModule1 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
}
if (cosine <= -(1.0 - FP64Utility.EPSYLON))
double squareModule2 = vector2.GetSquareModule();
if (squareModule2 <= FP64Utility.SQUARE_EPSYLON)
{
return 0.0;
}
double cosine = FP64Vector3.GetScalarProduct(vector1, vector2) / Math.Sqrt(squareModule1 * squareModule2);
if (1.0 - FP64Utility.EPSYLON <= cosine)
{
return 0.0;
}
if (cosine <= -(1.0 - FP64Utility.EPSYLON))
{
return FP64Angle.GetHalfCircle(unit);
}
}
return FP64Radians.ToUnits(Math.Acos(cosine), unit);
return FP64Radians.ToUnits(Math.Acos(cosine), unit);
}
public static double GetSquareDistance(in FP64Vector3 vector1, in FP64Vector3 vector2)