Why is tangent infinite sometimes? I am confused by the definition of tangent. The math textbook says it is because when cosine is 0 tangent becomes infinite. The intuition I have is that when one of adjacent or opposite is 0, then tangent is infinite. But isn't cosine only adjacent over hypotenuse? So is tangent theta only infinite if adjacent side is 0? What if adjacent side is theoretically infinite?
You can imagine the tangent in the unit circle as a line that tangency it in the start: $n\cdot 2\pi : n \in R$

That animation will give you the intuition for the asymptotes (where it goes to negative and positive infinity):



You can see that when you go the the angle $\frac{\pi}{2}$ for example, you are in a point in the circle, that creating a line from the origin to it, you have the same inclination as the tangent line, and that's why your graph is tending to $\infty$ and you get that asymptote in the graph.
Actucally the tangent to a curve means the value  of dy/dx i.e. tan() at some pt (x,y) on the curve so when the denominator in the equation of dy/dx becomes zero the tangent is infinite of tan() is infinite , if signifies that curve is straight line at that point.