atan
Calculates the arctangent of a number, returning the angle in degrees by default or radians when specified.
Instructions
Arctangent. Result in degrees by default, or radians with unit param.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | ||
| unit | No |
Implementation Reference
- cruncher.js:1433-1440 (handler)The 'atan' tool handler function. It computes the arctangent of a value using Math.atan(), then converts the result from radians to degrees (or keeps radians) based on the unit parameter or global angle mode.
/** * Calculates the inverse tangent (arctangent) of a value. * @param {Object} args - The arguments object. * @param {number} args.value - The value. * @param {string} [args.unit] - The unit ("degrees" or "radians"). * @returns {number} The angle whose tangent is value. */ atan: ({ value, unit }) => fromRadians(Math.atan(value), unit), - cruncher.js:436-455 (schema)The 'atan' tool schema registration in the toolsAll array. Defines name 'atan', description, and inputSchema requiring a 'value' (number) with optional 'unit' enum ('degrees', 'radians').
{ name: "atan", annotations: { title: "Arctangent", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: 'Arctangent. Result in degrees by default, or radians with unit param.', inputSchema: { type: "object", properties: { value: { type: "number" }, unit: { type: "string", enum: ["degrees", "radians"] }, }, required: ["value"], }, }, - cruncher.js:74-74 (registration)The 'atan' tool is registered in the 'standard' tool tier, making it available when CRUNCHER_TOOL_SET is 'standard' or 'full'.
"sine", "cosine", "tangent", "asin", "acos", "atan", - cruncher.js:121-121 (registration)'atan' listed in TRIG_TOOLS array, marking it as a trig function that runs in the main thread and is cacheable.
const TRIG_TOOLS = ["sine", "cosine", "tangent", "asin", "acos", "atan"]; - cruncher.js:134-134 (registration)'atan' listed in MAIN_THREAD_TOOLS set, ensuring it executes directly on the main thread without worker overhead.
"sine", "cosine", "tangent", "asin", "acos", "atan",