Overview

asin

asin is useful when you work with normalized ratios or rates and need to map them to angular values. For example, you can use asin to encode success or error rates as phase angles for cyclic signal analysis.

Usage#

Syntax#

asin(x)

Parameters#

Name Type Required Description
x real Yes A real number in the range [-1, 1].

Returns#

  • The arc sine of x in radians, in the range [-π/2, π/2].
  • null if x < -1 or x > 1.

Example#

Use asin to compute the arcsine of a value and return the angle in radians.

Query

print result = asin(0.5)

Run in Playground

Output

result
0.5236
  • acos: Returns the arc cosine. Use it when the cosine encoding is more appropriate for your data.
  • atan: Returns the arc tangent. Use it when the input isn't bounded to [-1, 1].
  • sin: Returns the sine. Use it to apply the forward transformation before using asin as the inverse.
  • radians: Converts degrees to radians. Use it if your angle data is in degrees before passing it to asin.
  • degrees: Converts radians to degrees. Use it to convert the asin result into degrees.

Other query languages#

Splunk SPL users

In Splunk SPL, asin() is available in the eval command with the same behavior: it returns the arc sine in radians for an input in [-1, 1].

Splunk example

| eval angle = asin(normalized_rate)

APL equivalent

['sample-http-logs']
| extend angle = asin(normalized_rate)
ANSI SQL users

In ANSI SQL, ASIN() is a standard mathematical function. It accepts a value in [-1, 1] and returns the arc sine in radians.

SQL example

SELECT ASIN(normalized_rate) AS angle FROM logs

APL equivalent

['sample-http-logs']
| extend angle = asin(normalized_rate)

Updated

Was this page helpful?