The cotangent is correct, but it looks like you found instead of .
C and D are complementary angles, so their cofunctions are equal:
and