/
atan.ts
43 lines (42 loc) · 1.09 KB
/
atan.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { FieldType } from '@terascope/types';
import {
FieldTransformConfig,
ProcessMode,
FunctionDefinitionType,
FunctionDefinitionCategory,
} from '../interfaces';
import { runMathFn } from './utils';
export const atanConfig: FieldTransformConfig = {
name: 'atan',
type: FunctionDefinitionType.FIELD_TRANSFORM,
process_mode: ProcessMode.INDIVIDUAL_VALUES,
category: FunctionDefinitionCategory.NUMERIC,
description: 'Returns the arctangent (in radians) of the given number',
examples: [
{
args: {},
config: {
version: 1,
fields: { testField: { type: FieldType.Float } }
},
field: 'testField',
input: 1,
output: 0.7853981633974483
}
],
create() {
return runMathFn(Math.atan);
},
accepts: [
FieldType.Number,
],
argument_schema: {},
output_type({ field_config }) {
return {
field_config: {
...field_config,
type: FieldType.Float
}
};
}
};