The series_sin function in APL returns the sine of each element in a numeric array. It applies the mathematical sine function element by element, producing a new array of the same length. You use series_sin when you want to transform numeric sequences into their trigonometric equivalents. This is useful for signal processing, data transformations, or preparing time series data for statistical and mathematical analysis.

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Splunk SPL doesn’t provide a direct equivalent to series_sin for arrays. Instead, you typically use the eval command with the sin() function to compute the sine of a single numeric value. In APL, series_sin applies sin() across an array in one step.
... | eval sin_val=sin(duration)
ANSI SQL provides the SIN() function, but it operates on single values rather than arrays. In APL, series_sin is vectorized and works directly on arrays without requiring iteration.
SELECT SIN(duration) AS sin_val
FROM traces;

Usage

Syntax

series_sin(arr)

Parameters

ParameterTypeDescription
arrdynamicAn array of numeric values.

Returns

A dynamic array where each element is the sine of the corresponding input element.

Use case examples

You can use series_sin to transform request durations into trigonometric values for advanced analysis, such as periodicity detection.Query
['sample-http-logs']
| summarize arr = make_list(req_duration_ms, 10)
| extend sin_arr = series_sin(arr)
Run in PlaygroundOutput
arrsin_arr
[120, 250, 500, 750][−0.58, −0.97, −0.52, 0.94]
This query collects a sample of request durations and applies series_sin to generate a transformed series for analysis.
  • series_abs: Returns the absolute value of each element in an array. Use it to normalize negative values in arrays.
  • series_acos: Computes the arccosine of each element in an array. Use when you want the inverse cosine.
  • series_atan: Computes the arctangent of each element in an array. Use when you want the inverse tangent.
  • series_cos: Returns the cosine of each element in an array. Use it when analyzing cyclical data with a phase shift.
  • series_tan: Returns the tangent of each element in an array. Use it when you want to transform arrays with tangent-based periodicity.