The tangent function is one of the main six trigonometric functions and is generally written as tan x. It is the ratio of the opposite side and the adjacent side of the angle in consideration in a right-angled triangle.