sine
Calculate the sine of an angle in degrees or radians.
Instructions
Sine. Angle in degrees by default, or radians with unit: "radians".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| angle | Yes | ||
| unit | No |
Implementation Reference
- cruncher.js:341-360 (schema)Input schema definition for the 'sine' tool, defining its name, description, and required parameters (angle with optional unit).
{ name: "sine", annotations: { title: "Sine", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: 'Sine. Angle in degrees by default, or radians with unit: "radians".', inputSchema: { type: "object", properties: { angle: { type: "number" }, unit: { type: "string", enum: ["degrees", "radians"] }, }, required: ["angle"], }, }, - cruncher.js:1400-1407 (handler)The actual handler function for 'sine': computes Math.sin(toRadians(angle, unit)), converting degrees to radians via the toRadians helper.
/** * Calculates the sine of an angle. * @param {Object} args - The arguments object. * @param {number} args.angle - The angle value. * @param {string} [args.unit] - The unit ("degrees" or "radians"). * @returns {number} The sine of the angle. */ sine: ({ angle, unit }) => Math.sin(toRadians(angle, unit)), - cruncher.js:1296-1307 (helper)The toRadians helper function used by the sine handler to convert angle from degrees to radians based on the unit parameter or global angleMode.
// --- Trigonometry Helpers --- /** * Converts an angle to radians if it's in degrees. * @param {number} angle - The angle value. * @param {string} [unit] - The unit ("degrees" or "radians"). * @returns {number} The angle in radians. */ const toRadians = (angle, unit) => { const resolved = unit || angleMode; return resolved === "degrees" ? angle * (Math.PI / 180) : angle; }; - cruncher.js:80-80 (registration)Registration of 'sine' in the standard tool set tier (line 80 of toolsAll definition, also listed in TRIG_TOOLS and MAIN_THREAD_TOOLS sets).
"sine", "cosine", "tangent", "asin", "acos", "atan", - cruncher.js:127-127 (registration)TRIG_TOOLS set includes 'sine' so results are cached after execution.
const TRIG_TOOLS = ["sine", "cosine", "tangent", "asin", "acos", "atan"];