Trigonometric functions


ABC implements a full range of trigonometric functions. The angle mode setting determines how the arguments to trig functions are interpreted. For example, if the angle mode is radians the trig functions expect their arguments in radians and the inverse trig functions return angles in radians.

There are 24 trig functions in total. There are 6 core functions and 6 inverse functions. Each of these functions has a hyperbolic counterpart giving 24 in total. The names of the inverse functions are the same as the core functions, execpt a is prepended. The names of the hyperbolic functions are the same as the others except they have h appended.

For Example: sin, asin, sinh, asinh. These are sine, inverse sine, hyperbolic sine and inverse hyperbolic sine respectively.

The trig functions are implemented as operators, so you can call them without brackets.

Operators

Operator Description Examples
sin x sine sin(3pi/2), asin(1/2)
cos x cosine cos(3pi/2), cosh(3pi/2)
tan x tangent tan(pi/2) (undefined!), atan(1/2)
cot x cotangent (1/tan) ...
sec x secant (1/cos) ...
cosec x cosecant (1/sin) ...