Trigonometric Functions

Prev Next

Function Names

sin, sin deg, cos, cos deg, tan, tan deg, asin, asin deg, acos, acos deg, atan, atan deg

Description

All common trigonometric functions are supported. The function names ending with deg use angle measures in degrees and not in radians.

Radian based Degree based Function description
sin sin deg Sine
cos cos deg Cosine
tan tan deg Tangent
asin asin deg Arcsine (inverse sine)
acos acos deg Arccosine (inverse cosine)
atan atan deg Arctangent (inverse tangent)

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
numeral Angle or value

Value to be raised to the power exponent

Return value

TypeDescription
numeral Result

Calculated value

Exceptions

For selected functions (e.g. asin): Values are outside valid range

Examples

      pi[] = asin(1)*2;
      echo( cos( pi[] / 4 ) ); // 45 deg.
      echo( sin deg( 30 ) );   // 30 deg.
      echo( asin deg( 1 ) );   // 90 deg.

Output

0.7071067812
0.5
90
Try it yourself: Open LIB_Function_sin.b4p in B4P_Examples.zip. Decompress before use.

See also

Hyperbolic Functions