This function is used to calculate diagonal of given Rect's width and height.
num calcDiagonal(num width, num height) { return math.sqrt(width * width + height * height); }