Some miscellaneous cleanups left over from a fix/cleanup combo: - Use const variables - Use the C++ `math` namespace functions - Use `std::array` for arrays with size known at compile time - Use `MutableSpan` instead of reference to array Differential Revision: https://developer.blender.org/D17094