Calculates the compass bearing (0-360°) from one geographic coordinate to another. Use via MCP in Cursor or Windsurf for navigation calculations, or call GET /v1/geo/bearing with lat/lng pairs. Returns precise directional headings for mapping, routing, and location-based applications. Essential for GPS navigation and spatial analysis.
curl "https://tinyfn.io/v1/geo/bearing" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/geo/bearing', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/geo/bearing',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's geolocation tools:
{
"mcpServers": {
"tinyfn-geo": {
"url": "https://tinyfn.io/mcp/geo",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Provide start and end coordinates as latitude/longitude pairs. The tool returns bearing in degrees (0-360°) where 0° is North, 90° is East, 180° is South, and 270° is West.
Bearing gives you the compass direction (which way to head), while distance tells you how far to travel. Use both together for complete navigation between two points.
Yes, all MCP-compatible editors (Cursor, Claude Code, Windsurf, Cline, Zed, OpenClaw) can call this tool directly for geographic calculations in your code.
Yes, it uses great circle calculations on the WGS84 ellipsoid, providing accurate bearings for any distance including intercontinental routes.
The calculation handles edge cases like polar coordinates and international dateline crossings correctly, returning valid bearings for all valid lat/lng inputs.
Get your free API key and start using Calculate Bearing in seconds.
Get Free API Key