diff --git a/Dalamud/Interface/Animation/EasingFunctions/InOutCirc.cs b/Dalamud/Interface/Animation/EasingFunctions/InOutCirc.cs new file mode 100644 index 000000000..97fd1a2d2 --- /dev/null +++ b/Dalamud/Interface/Animation/EasingFunctions/InOutCirc.cs @@ -0,0 +1,29 @@ +using System; + +namespace Dalamud.Interface.Animation.EasingFunctions +{ + /// + /// Class providing an "InOutCirc" easing animation. + /// + public class InOutCirc : Easing + { + /// + /// Initializes a new instance of the class. + /// + /// The duration of the animation. + public InOutCirc(TimeSpan duration) + : base(duration) + { + // ignored + } + + /// + public override void Update() + { + var p = this.Progress; + this.Value = p < 0.5 + ? (1 - Math.Sqrt(1 - Math.Pow(2 * p, 2))) / 2 + : (Math.Sqrt(1 - Math.Pow((-2 * p) + 2, 2)) + 1) / 2; + } + } +}