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 users
Splunk SPL users
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.ANSI SQL users
ANSI SQL users
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.Usage
Syntax
Parameters
Parameter | Type | Description |
---|---|---|
arr | dynamic | An 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 Run in PlaygroundOutput
This query collects a sample of request durations and applies
series_sin
to transform request durations into trigonometric values for advanced analysis, such as periodicity detection.Queryarr | sin_arr |
---|---|
[120, 250, 500, 750] | [−0.58, −0.97, −0.52, 0.94] |
series_sin
to generate a transformed series for analysis.List of related functions
- 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.