the joke is based on math. with triangles, every side has a sine, cosine, and tangent. the tangent of a side is found by multiplying the sine and cosine of the same side. with triangles, you label the sides a, b, and c. and in short hand, sine is sin, cosine is cos, and tangent is tan. so if you divide the sine by the tangent, you get the cosine. in other words:
the sine of side b (sin b) divided by the tangent of side by (tan b) equals the cosine of side b (cos b)