It looks like you might have swapped the definitions of a, b. Have another look.
The triangle that was drawn in the image is not correct, your image. This because the the size of angle corresponds the length the side. So since 90 degrees is largest angle the side opposite the angle i.e...