Calculates the hypotenuse of a right triangle using the Pythagorean theorem (c² = a² + b²). Access via MCP in Cursor, Windsurf, and other AI coding tools, or REST API at `/v1/math/hypotenuse`. Pass two side lengths, get precise decimal results. Essential for geometry calculations, distance formulas, and vector magnitude computations.
curl "https://tinyfn.io/v1/math/hypotenuse" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/hypotenuse', {
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/hypotenuse',
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"
}
}
}
}
Call the hypotenuse tool with parameters for the two perpendicular sides (a and b). The MCP tool returns the exact hypotenuse length using the Pythagorean theorem.
Accepts decimal numbers, integers, and fractions for both side lengths. Returns high-precision decimal results for accurate geometric calculations.
Yes, for 2D distance. For 3D points, calculate the 2D distance first, then use that result with the third dimension as inputs to get the 3D distance.
Handles a wide range of numeric inputs with high precision. Useful for both microscopic measurements and astronomical distances in engineering calculations.
Provides deterministic, high-precision results without floating-point errors. AI agents get exact mathematical results instead of potentially inaccurate computed approximations.