Quellcode durchsuchen

add floatlerp function because I keep feeling like I want it

Joseph Brandenburg vor 5 Monaten
Ursprung
Commit
519c4b9188
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      utilities.py

+ 2 - 0
utilities.py

@@ -23,6 +23,8 @@ def prOrange(*args): print (*[wrapOrange(arg) for arg in args])
 #                               wrapRed, wrapGreen, wrapPurple, wrapWhite,
 #                               wrapOrange,)
 
+def float_lerp(a : float, b : float, factor : float)  -> float:
+    return (a * (1.0 - factor)) + (b * factor)
 
 # A fuction for getting to the end of a Reroute.
 # TODO: this seems really inefficient!