Converts angles from degrees to radians.

Note

Math functions on ARM architecture may return different results in very high-precision calculationsc compared to Intel/AMD architectures.

ParameterTypeRequiredDefault ValueDescription
asstringoptional[a] _deg2rad The name of the output field.
field[b]stringrequired   The name of the input field.

[a] Optional parameters use their default value unless explicitly set.

[b] The parameter name field can be omitted.

Hide omitted argument names for this function

Show omitted argument names for this function

Click + next to an example below to get the full details.

Convert Degrees to Radians

Convert angles from degrees to radians using the math:deg2rad() function

Query
logscale
myvalue := 180.0
        | math:deg2rad(myvalue, as=radians)
Introduction

Common degree to radian conversions:

  • 180 degrees = π radians

  • 90 degrees = π/2 radians

  • 45 degrees = π/4 radians

  • 30 degrees = π/6 radians

In this example, the math:deg2rad() function is used to convert the degree value 180 to radians.

Step-by-Step
  1. Starting with the source repository events.

  2. logscale
    myvalue := 180.0

    Assigns 180 degrees to a field named myvalue. This value should convert to approximately π radians.

  3. logscale
    | math:deg2rad(myvalue, as=radians)

    Converts the degree value in the myvalue field to radians and returns the result in a field named radians.

  4. Event Result set.

Summary and Results

The query converts an angle measurement from degrees to radians. This conversion is essential when working with trigonometric functions, as many mathematical operations require radians rather than degrees.

This query is useful for preparing angular measurements for mathematical calculations, working with geometric computations, or transforming human-readable angles into formats suitable for mathematical operations. The conversion factor used is π/180 (approximately 0.0174533 radians per degree).

Sample output from the incoming example data:

radians
3.14159

The result shows that 180 degrees converts to π radians (approximately 3.14159), demonstrating the standard conversion between degrees and radians.