series_asin
You use series_asin when you need to invert sine transformations stored in array form, for example, to reconstruct angular information from periodic signals or normalize log and trace metrics for statistical or geometric analysis.
Usage#
Syntax#
series_asin(array)Parameters#
| Parameter | Type | Description |
|---|---|---|
array |
dynamic | A dynamic array of numeric values. Each element should be between -1 and 1, the valid domain of the arc sine function. |
Returns#
A dynamic array of the same length as the input, where each element is the arc sine (in radians) of the corresponding input element.
Use case examples#
When analyzing HTTP logs, you can normalize request durations to the range [-1, 1] and then apply series_asin to transform them into angular values for further statistical analysis.
Query
['sample-http-logs']
| summarize durations = make_list(req_duration_ms, 5) by id
| extend normalized = series_divide(durations, 1000.0)
| extend angles = series_asin(normalized)Output
| id | durations | normalized | angles |
|---|---|---|---|
| A12 | [100, 200, 300, 400, 500] | [0.1, 0.2, 0.3, 0.4, 0.5] | [0.100, 0.201, 0.305, 0.412, 0.524] |
The query collects request durations per user ID, normalizes them, and applies series_asin to transform values into angles.
For traces, you can normalize span durations and use series_asin to derive angular representations, which can be helpful in detecting periodic workload patterns.
Query
['otel-demo-traces']
| summarize spans = make_list(duration, 5) by ['service.name']
| extend normalized = series_divide(spans, 10000000.0)
| extend angles = series_asin(normalized)Output
| service.name | spans | normalized | angles |
|---|---|---|---|
| frontend | [12000000, 15000000, 20000000] | [1.2, 1.5, 2.0] | [null, null, null] |
| cartservice | [5000000, 8000000, 10000000] | [0.5, 0.8, 1.0] | [0.524, 0.927, 1.571] |
This query collects spans per service, normalizes their durations, and computes arc sine values. Values outside [-1, 1] result in null.
When examining security logs, you can normalize request durations for suspicious requests and use series_asin to highlight anomalous access patterns.
Query
['sample-http-logs']
| summarize requests = make_list(req_duration_ms, 5) by ['geo.country']
| extend normalized = series_divide(requests, 1000.0)
| extend angles = series_asin(normalized)Output
| geo.country | requests | normalized | angles |
|---|---|---|---|
| US | [50, 200, 400, 600] | [0.05, 0.2, 0.4, 0.6] | [0.050, 0.201, 0.412, 0.644] |
The query groups requests by country and converts normalized durations into angular values for anomaly detection.
List of related functions#
- series_acos: Returns the arc cosine of each element in an array. Use when you need to invert cosine transformations instead of sine.
- series_atan: Returns the arc tangent of each element in an array. Useful for handling tangent-derived data.
Other query languages#
Splunk SPL users
Splunk SPL doesn’t provide a direct equivalent of series_asin that operates over arrays. Instead, SPL typically requires you to apply asin() to individual fields or use mvmap to apply the function to multivalue fields. In APL, series_asin simplifies this by applying the operation to each element of a dynamic array in one step.
Splunk example
... | eval angle=mvmap(values, asin(x))APL equivalent
datatable(values: dynamic)
[
dynamic([0.0, 0.5, 1.0])
]
| extend angle = series_asin(values)ANSI SQL users
ANSI SQL databases generally provide ASIN() for scalar values but do not include native array-processing functions. You would need to unnest an array into rows, apply ASIN(), and then aggregate the results back into an array. APL’s series_asin eliminates this boilerplate by letting you compute the arc sine across the entire array at once.
SQL example
SELECT array_agg(ASIN(x))
FROM UNNEST(ARRAY[0.0, 0.5, 1.0]) AS t(x);APL equivalent
datatable(values: dynamic)
[
dynamic([0.0, 0.5, 1.0])
]
| extend angle = series_asin(values)