ATAN: Calculating an Angle Given its Tangent

Given the tangent of an angle in radians, ATAN (arctangent) returns an angle between -(pi/2) and pi/2 radians.

Calculate an Angle Given its Tangent

ATAN(expression)

where:

expression

Numeric

Is the tangent of an angle.

Calculating the Arctangent of a Value

The following request calculates the arctangent of 0, PI/4 radians, and PI radians.

DEFINE FILE ggsales
PI1 = PI();
PI4 = PI()/4;
TAN1 = TAN(0);
TAN3 = TAN(PI4);
TAN4 = TAN(PI1);
END
 
TABLE FILE ggsales
PRINT 
TAN1 TAN2 TAN3 TAN4
OVER
COMPUTE
ARCTAN1/D12.2 = ATAN(TAN1);
ARCTAN3/D12.2 = ATAN(TAN3);
ARCTAN4/D12.2 = ATAN(TAN4);
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.

ATAN calculates the arctangent of 0 (zero).

ATAN(0)

The result is 0 (zero).