We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fed59fe commit c320493Copy full SHA for c320493
osu.Game.Rulesets.Sentakki/Extensions/MathExtensions.cs
@@ -21,7 +21,19 @@ public static float NormalizeAngle(this float angle)
21
/// GetDeltaAngle(a,b) = -20
22
/// </code>
23
/// </example>
24
- public static float AngleDelta(float a, float b) => (b - a).Mod(360);
+ public static float AngleDelta(float a, float b)
25
+ {
26
+ float delta = b - a;
27
+
28
+ delta %= 360;
29
30
+ if (delta < -180)
31
+ delta += 360;
32
+ else if (delta > 180)
33
+ delta -= 360;
34
35
+ return delta;
36
+ }
37
38
/// <summary>
39
/// Computes the angle (in degrees) of <c>target</c> around <c>origin</c>
0 commit comments