Is there a math function or something else that I can use to find the difference between 2 numbers, similar to magnitude?
That would be subtraction. I guess math.abs(a - b) can be useful if you’re not sure which number is higher. This would ensure you end up without a negative number because of that.
abs stands for absolute value. It returns the non-negative magnitude of a number, removing any negative sign. For example, abs(-5) is 5.
(X + Y)/amount
thank you so much this is exactly what I was looking for