COT: Calculating the Cotangent of an Angle

Given an angle in radians, COT calculates the cotangent of the angle.

Calculate the Cotangent of an Angle

COT(expression)

where:

expression

Numeric

Is an angle in radians.

Calculating the Cotangent of an Angle

The following request calculates the cotangent of PI/2 and PI/4 radians.

DEFINE FILE ggsales
PI2 = PI()/2;
PI4 = PI()/4;
END

TABLE FILE ggsales
PRINT COMPUTE
COTGENT2 = COT(PI2);
COTGENT3 = COT(PI4);
BY DATE
WHERE RECORDLIMIT EQ 1
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF,$
ENDSTYLE
END

The output is shown in the following image.

COT calculates the cotangent of PI/2 radians.

COT(1.57)

The result is 0 (zero).