# Haversine Distance Engine MCP

> Haversine Distance Engine calculates precise geographic distances between any two GPS coordinates instantly. It uses the accurate Haversine formula for spherical routing, giving you true distance over Earth's surface—not just a straight-line guess. Stop relying on simple approximations and get mathematically exact measurements in kilometers, miles, meters, or nautical miles.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** geospatial, spherical-trigonometry, distance-calculation, gps-data, mathematics

## Description

When your agent needs to know how far two points are, it can’t just pull up a basic map estimate. The Haversine Distance Engine fixes that problem by applying complex spherical trigonometry directly. You feed it the latitude and longitude for Point A and Point B; the MCP handles the rest. It returns the true distance over the Earth's surface, accurately measured in multiple units without any manual conversions. This is critical when you’re dealing with logistics planning or tracking assets across continents. By connecting this functionality through Vinkius, your AI client gets access to mathematical precision, turning guesswork into reliable data points that drive real operational decisions.

## Tools

### calculate_distance
Calculates the exact geographic distance between two sets of coordinates using the Haversine formula, returning results in kilometers and miles.

## Prompt Examples

**Prompt:** 
```
Calculate the exact geographic distance in kilometers between London (51.5074, -0.1278) and Paris (48.8566, 2.3522).
```

**Response:** 
```
✅ **Calculation Complete:** The exact Haversine distance is `343.46` km.
```

**Prompt:** 
```
What is the distance in miles from the warehouse (-23.5505, -46.6333) to the delivery address (-22.9068, -43.1729)?
```

**Response:** 
```
✅ **Result:** The spherical distance is `223.32` miles.
```

**Prompt:** 
```
Convert the distance between these coordinates into exact meters for a micro-mobility agent.
```

**Response:** 
```
✅ **Geo Metrics:** The coordinates are exactly `1,250.45` meters apart.
```

## Capabilities

### Determine distance between coordinates
Passes two pairs of GPS latitude and longitude values and calculates the exact geographic separation.

### Calculate precise metric distances
Returns measurements in kilometers, miles, meters, or nautical units, allowing for multi-unit comparisons.

## Use Cases

### Comparing two warehouse sites
A supply chain manager needs to know which of two potential new distribution centers is closer to the primary port. Instead of pulling up three different mapping tools and cross-referencing data, they ask their agent to use `calculate_distance` with the coordinates for both ports. The engine instantly provides the accurate separation in miles, allowing them to make an informed site decision.

### Validating a micro-mobility route
A city planner is reviewing autonomous vehicle paths and needs to know if the designed path segment is within 1.5 kilometers of another landmark. They feed the coordinates into the MCP, which returns the exact distance in meters, confirming compliance with strict geo-fencing rules.

### Calculating flight legs
An airline analyst needs to calculate the great-circle separation between two airports using their latitude/longitude. They use `calculate_distance` to get a precise distance in kilometers, which they then use to validate fuel consumption models.

### Mapping field survey boundaries
A construction site manager has surveyed four corner points of a plot of land and needs the separation between two corners. Running `calculate_distance` prevents them from using simple plane geometry, ensuring their blueprints reflect true Earth curvature.

## Benefits

- You get mathematically precise distance metrics. Forget simple straight-line guesses; this uses the Haversine formula for real spherical accuracy.
- It handles multiple units automatically. You don't need to worry about manual conversions between kilometers, miles, or meters—the engine does it all.
- It immediately solves a common agent problem: LLMs can’t calculate geometry. This MCP brings reliable spatial reasoning right into your workflow.
- You keep your code clean and focused on logic. By outsourcing complex trigonometry to the Haversine Distance Engine, you reduce calculation errors in your main application.
- The `calculate_distance` tool ensures that any distance comparison—whether for logistics or science—is based on validated, geo-accurate data.

## How It Works

The bottom line is that you get reliable, accurate geographic metrics every single time, regardless of how far apart the points are.

1. You tell your AI client to calculate the distance between two sets of GPS coordinates.
2. The MCP sends these latitude/longitude pairs to the Haversine Distance Engine for calculation using the complex spherical formula.
3. Your agent receives the exact, mathematically proven distance in multiple units (km, miles, meters) back in a structured format.

## Frequently Asked Questions

**How does the Haversine Distance Engine calculate distance?**
It uses the specific mathematical Haversine formula, which accounts for Earth's spherical shape. This means it provides the true great-circle distance rather than a simple straight line.

**What units can I get from `calculate_distance`?**
`calculate_distance` returns the separation in multiple standard formats: kilometers, miles, and meters. You don't have to request them separately.

**Is this useful for measuring distances between cities?**
Yes. Because it uses spherical trigonometry, it accurately calculates distance across vast geographical areas, making it perfect for inter-city or continental comparisons.

**Does Haversine Distance Engine account for roads?**
No, this MCP measures the direct, straight-line separation (geodesic distance) between two points. It does not factor in real-world factors like road networks or elevation.

**If I provide invalid coordinates to `calculate_distance`, how does the Haversine Distance Engine handle the error?**
The engine returns a specific validation error if the latitude or longitude inputs are out of range. It won't crash; instead, it sends an explicit failure message telling you exactly what data needs fixing.

**How quickly does the Haversine Distance Engine calculate distances using `calculate_distance`?**
The calculation is near-instantaneous. Since this MCP runs complex spherical trigonometry, it's optimized for speed and processes distance metrics immediately upon request.

**Does the use of the Haversine Distance Engine affect my data privacy or security?**
The tool only computes a metric and doesn't store your GPS coordinates. Your input location data is handled securely, ensuring that distance calculations remain private.

**Are there any rate limits when running multiple calls to `calculate_distance` in one workflow?**
Vinkius manages the service capacity, so you generally don't hit internal rate limits during normal usage. If you send a massive volume of requests, your AI client will manage throttling for you.

**Does it calculate driving distance?**
No, it calculates the 'as-the-crow-flies' spherical distance.

**Is it local?**
Yes, 100% local mathematical calculation. No API key required.

**What units does it return?**
Kilometers (km), Miles (mile), Meters (meter), and Nautical Miles (nmi).