I have a square and I want to know the vertical distance between the highest point and the lowest point. The square is $10 \times 10$ cm. The amount of degrees the square is rotated can be anything, but I need a formula that always works no matter the amount of degrees it is rotated.
Does anyone know a formula to calculate this?
So in this picture I would need to know the length of the red line:

Suppose that the square is rotated by an angle of $\theta$. You can draw a square $B$ that just touches the vertex of your original square, as in here ($\theta$ would be angle $STY$):
Thus, the height you are looking is the sum of $XS$ and $SY$, which are equal to the shortest sides of triangle STY. Thus, the height equals $(\cos(\theta)+\sin(\theta))L,$ where $L$ is the side length of the original square (in your case, 10 cm).