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.
Hide omitted argument names for this function
Omitted Argument NamesThe argument name for
field
can be omitted; the following forms of this function are equivalent:logscale Syntaxmath:deg2rad("value")
and:
logscale Syntaxmath:deg2rad(field="value")
These examples show basic structure only.
math:deg2rad()
Examples
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
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
Starting with the source repository events.
- logscale
myvalue := 180.0
Assigns
180
degrees to a field named myvalue. This value should convert to approximatelyπ
radians. - 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.
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.