The tan function is undefined where the cosine is zero, which occurs at angles 90° + 180°k (or π/2 + kπ in radians, where k is any integer). This happens because tan(θ) = sin(θ) / cos(θ), and division by zero is undefined.
https://docs.vultr.com/clang/s....tandard-library/math
