Reference to the trigonometric utility functions

Summary

Converts between radians and degrees.

Function SyntaxDescriptionInput ValuesOutput Values
toDegrees(<tsExpression>) Conversion from radians to degrees Radians Degrees
toRadians(<tsExpression>) Conversion from degrees to radians Degrees Radians

Parameters

ParameterDescription
tsExpression Expression describing a constant or a time series of input values to be converted.

Description

Each trigonometric utility function converts the data values described by the input expression:

  • toRadians() interprets each input value as a number of degrees, and returns a corresponding output value that is the equivalent number of radians.
  • toDegrees() interprets each input value as a number of radians, and returns a corresponding output value that is the equivalent number of degrees.

Each trigonometric utility function returns its results as follows:

  • If tsExpression is a constant, then the function returns a continuous series of data points.
  • If tsExpression describes one or more time series, then the function returns a new time series for each input time series. Each value in a new time series is obtained by converting the value of the corresponding point in the input time series.

You typically use toRadians() to convert the input values of the trigonometric functions sin(), cos(), or tan(). For example, to find the sine of a metric after converting its values to radians: sin(toRadians(ts(my.metric)))

You typically use toDegrees() to convert the output values of the trigonometric functions asin(), acos(), or atan(). For example, to obtain the arcsine of a metric, and return its results in degrees: toDegrees(asin(ts(my.metric)))

See Also

Trigonometric Functions