@nodescript/stdlib
Version:
Standard Node Definitions
23 lines (22 loc) • 525 B
JavaScript
export const module = {
version: '1.0.4',
moduleName: 'Math / Arctan2',
description: `
Computes the arctangent of the angle between positive X axis
and the ray to the point (x, y) in Cartesian system.
`,
params: {
x: {
schema: { type: 'number' },
},
y: {
schema: { type: 'number' },
},
},
result: {
schema: { type: 'number' },
}
};
export const compute = params => {
return Math.atan2(params.x, params.y);
};