FunkPanion/scripts/MathUtils.gd
2024-11-23 14:36:52 -06:00

9 lines
204 B
GDScript

class_name MathUtils
static func average(numbers: Array) -> float:
var sum = 0.0
var size = numbers.size() - 1
for n in size:
var diff = numbers[n + 1] - numbers[n]
sum += diff
return sum / size