Computes the sine of an angle with mathematical precision. Available via GET /v1/math/sin or as an MCP tool in Cursor and other AI editors. Pass an angle in radians to get the exact sine value — sin(π/2) returns 1.0. Essential for trigonometric calculations in AI-assisted coding without floating-point approximation errors.
curl "https://tinyfn.io/v1/math/sin" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/sin', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/math/sin',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's math tools:
{
"mcpServers": {
"tinyfn-math": {
"url": "https://tinyfn.io/mcp/math",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
The function expects angles in radians. To convert degrees to radians, multiply by π/180 or use a conversion tool first.
Connect TinyFn's MCP server to Cursor, Windsurf, or other supported editors, then reference the sin tool in prompts for precise trigonometric calculations during development.
TinyFn's sin provides deterministic results across environments, eliminating potential floating-point inconsistencies that can occur with different JavaScript engines or math libraries.
Yes, the function handles large angles correctly by computing sine mathematically rather than using approximations that might lose precision with extreme values.
Returns a precise decimal number, typically with full floating-point precision. For example, sin(0) returns exactly 0, sin(π/6) returns 0.5.