9 lines
204 B
GDScript
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
|