COT function returns the cotangent of an input argument.
In math, given the ABC triangle, the cotangent of an angle (A) is defined as the ratio between the length of the adjacent side (b) to the length of the opposite side (a) as the follownig formula:
cot A = b / a
The following statement shows the syntax of the
COT function accepts a
numeric_expression that represents the angle in radians for which the cotangent is calculated. The
numeric_expression must not evaluate to zero.
COT function returns a floating-point number.
The following example returns the cotangents of π/6 and π/4.
SELECT COT(PI()/6) cot_one_sixth_pi,
cot_one_sixth_pi | cot_one_fourth_pi
1.73205080756888 | 1
Note that we use the
PI function to get the π constant.
Most database systems support the
COT function with the same behavior.