The cosine is correct, but it looks like you found instead of .
A and B are complementary angles, so their cofunctions are equal:
and