It looks like you confused cotangent with tangent and cosine with secant. Remember that cotangent is adjacent over opposite and cosine is adjacent side over hypotenuse.