Check the picture below.
let's notice that the red triangle is a 30-60-90 triangle, and the green one is a 45-45-90 triangle.