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