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