public static double Repeat(double t, double length) { return(t - Mathd.Floor(t / length) * length); }
public static double PingPong(double t, double length) { t = Mathd.Repeat(t, length * 2d); return(length - Mathd.Abs(t - length)); }
public static double SmoothDampAngle(double current, double target, ref double currentVelocity, double smoothTime, double maxSpeed, double deltaTime) { target = current + Mathd.DeltaAngle(current, target); return(Mathd.SmoothDamp(current, target, ref currentVelocity, smoothTime, maxSpeed, deltaTime)); }
public static bool Approximately(double a, double b) { return(Mathd.Abs(b - a) < Mathd.Max(1E-06d * Mathd.Max(Mathd.Abs(a), Mathd.Abs(b)), 1.121039E-44d)); }
public static double SmoothStep(double from, double to, double t) { t = Mathd.Clamp01(t); t = (-2.0 * t * t * t + 3.0 * t * t); return(to * t + from * (1.0 - t)); }
public static double MoveTowardsAngle(double current, double target, double maxDelta) { target = current + Mathd.DeltaAngle(current, target); return(Mathd.MoveTowards(current, target, maxDelta)); }
public static double Lerp(double from, double to, double t) { return(from + (to - from) * Mathd.Clamp01(t)); }