diff --git a/BasicGeometry/FP32Versor.cs b/BasicGeometry/FP32Versor.cs index 0912aab..ae923c3 100644 --- a/BasicGeometry/FP32Versor.cs +++ b/BasicGeometry/FP32Versor.cs @@ -100,7 +100,7 @@ namespace BasicGeometry return FP32Angle.GetHalfCircle(unit); } - return FP32Radians.ToUnits(2.0f * MathF.Acos(s0), unit); + return FP32Radians.ToUnits(2.0f * MathF.Acos(this.s0), unit); } public readonly void MakeRotationMatrix(out FP32Matrix3x3 matrix) diff --git a/BasicGeometry/FP64Versor.cs b/BasicGeometry/FP64Versor.cs index bd1396e..b750c4e 100644 --- a/BasicGeometry/FP64Versor.cs +++ b/BasicGeometry/FP64Versor.cs @@ -103,7 +103,7 @@ namespace BasicGeometry return FP64Angle.GetHalfCircle(unit); } - return FP64Radians.ToUnits(2.0 * Math.Acos(s0), unit); + return FP64Radians.ToUnits(2.0 * Math.Acos(this.s0), unit); } public readonly void MakeRotationMatrix(out FP64Matrix3x3 matrix) @@ -254,12 +254,12 @@ namespace BasicGeometry return; } - double module = Math.Sqrt(squareModule); + double multiplier = Math.Sqrt(1.0 / squareModule); - this.s0 /= module; - this.x1 /= module; - this.x2 /= module; - this.x3 /= module; + this.s0 *= multiplier; + this.x1 *= multiplier; + this.x2 *= multiplier; + this.x3 *= multiplier; } public static void Combine(in FP64Versor second, in FP64Versor first, out FP64Versor result)