Two more functions for LUA math module
math.diag(x1[, ...])  returns the diagonal of an n-dimensional box
math.clamp(x, min, max)