Calculate the cosecant of any angle in degrees or radians, with pole detection.
The cosecant is the reciprocal of sine: cosec(θ) = 1/sin(θ) = hypotenuse/opposite. It is undefined where sin = 0, i.e. at multiples of 180°.
Cosecant definition
cosec θ = 1 / sin θ = hypotenuse / opposite
cosec(30°) = 1/sin(30°) = 1/0.5 = 2.
At 0°, 180°, 360° and all multiples of 180° — wherever sine equals zero.