series_atan

This page explains how to use the series_atan function in APL.

The series_atan function computes the arc tangent (inverse tangent) for each element in a numeric array (also known as a series). You use it to transform a dynamic array of numbers into their corresponding arc tangent values, expressed in radians. This is useful when you work with time series or array data and want to normalize, analyze, or transform it using trigonometric operations.

You often use series_atan in scenarios where you want to transform numeric measurements into angular values for further statistical analysis, pattern recognition, or anomaly detection.

Usage

Syntax

series_atan(array)

Parameters

ParameterTypeDescription
arraydynamicA dynamic array of numeric values.

Returns

A dynamic array with the arc tangent of each input element. The results are in radians.

Use case examples

You want to analyze request durations by converting them into angular values for specialized statistical transformations.

Query

['sample-http-logs']
| summarize durations = make_list(req_duration_ms)
| extend atan_durations = series_atan(durations)

Run in Playground

Output

durationsatan_durations
[10, 200, 5000][1.4711, 1.5658, 1.5706]

The query aggregates request durations, then transforms them into their arc tangent equivalents for normalized comparison.

You want to transform span durations into angular values for advanced time series modeling.

Query

['otel-demo-traces']
| summarize spans = make_list(duration) by ['service.name']
| extend atan_spans = series_atan(spans)

Run in Playground

Output

service.namespansatan_spans
frontend[00:00:01, 00:00:03][0.7854, 1.2490]
checkoutservice[00:00:05, 00:00:07][1.3734, 1.4289]

The query collects span durations by service and transforms them into arc tangent values.

You want to analyze failed login attempts by transforming their request durations into angular values.

Query

['sample-http-logs']
| summarize failed_durations = make_list(req_duration_ms) by id
| extend atan_failed = series_atan(failed_durations)

Run in Playground

Output

idfailed_durationsatan_failed
user42[20, 200, 800][1.5208, 1.5658, 1.5696]

The query collects durations and applies the arc tangent function element-wise.

  • series_asin: Applies the arc sine function element-wise to array values. Use this when you need the inverse sine instead of the inverse cosine.
  • series_acos: Returns the arc cosine of each element in an array. Use when you need to invert cosine transformations instead of sine.

Other query languages