Tangent, written tan(θ), measures an angle’s steepness. In a right triangle, it is the opposite side divided by the adjacent side: tan(θ) = opposite / adjacent. It can also be written as sin(θ) / cos(θ). On a coordinate plane, tangent gives the slope of the line from the origin to a point at angle θ. section 9.1.1 section 9.6
Read tangent values around a circle
At 0°, tan is 0; at 45°, it is 1; and at 135°, it is −1. At 90° and 270°, tangent is undefined because the angle is vertical, so there is no finite slope. This makes tangent useful for reasoning about direction and steepness, while sine and cosine provide circular x and y positions. section 9.1.1 section 9.5
Figure 9.3 The graph of tan(θ) for −2π ≤ θ ≤ 2π
Use the tangent graph to see its repeating values and the vertical gaps where tangent is undefined. section 9.1.1
CSS provides tan(angle), and JavaScript provides Math.tan(angle). Both return a tangent value from an angle or number. The CSS trig functions became broadly available in major evergreen browsers from March 2023; tan(90deg) is undefined, so vertical-angle cases need deliberate handling. section 9.1.5
For visual interfaces, tangent belongs to the same practical trig toolkit as sine and cosine: rotating or skewing elements, building curved animation, and making directional calculations. Use sine and cosine when you need a point’s circular position; use tangent when the important result is the line’s steepness. section 9.0 section 9.1.1
