10 lines
204 B
GDScript3
10 lines
204 B
GDScript3
|
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
|