Calculate cross track error
calculate_cross_track_errorCalculate cross track error (XTE) — the perpendicular distance from a vessel position to the great-circle track between two waypoints — plus side of track (port/starboard) and along-track distances.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"start": "<start>",
"end": "<end>",
"position": "<position>"
},
"name": "calculate_cross_track_error"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | Track end waypoint (B). | |
| start | Yes | Track start waypoint (A). | |
| position | Yes | Vessel position (P). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xte | Yes | Cross track error magnitude — perpendicular distance from position to track. | |
| side | Yes | Side of the track the position lies on, travelling start → end. | |
| beyondEnd | Yes | True when the abeam point falls beyond the end waypoint. | |
| remaining | Yes | Distance remaining along the track from the abeam point to the end waypoint. | |
| alongTrack | Yes | Distance from start along the track to the point abeam of the position. Negative when the position is abeam a point behind the start. | |
| beforeStart | Yes | True when the abeam point falls before the start waypoint. | |
| nearestPoint | Yes | Nearest point on the track (foot of the perpendicular), decimal degrees. |