CY
API & MCPDogfennaeth

Platfform Datblygwr Mariner GPS Tools

Cyfrifo cyfeiriant gwir cychwynnol

Cyfrifo'r cyfeiriant gwir cychwynnol o un safle i un arall.

Rhyngwynebau

POST
Pwynt diwedd REST/api/v1/bearing
MCP
Enw offeryncalculate_bearing

Cais

Anfonwch y cais fel JSON. Mae cleientiaid MCP yn pasio'r un meysydd ag argumentau'r offeryn.

cURLshell
curl -X POST https://marinergps.tools/api/v1/bearing \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "from": {
    "lat": 50.1,
    "lng": -4.2
  },
  "to": {
    "lat": 49.8,
    "lng": -3.1
  }
}'
Corff y caisjson
{
  "from": {
    "lat": 50.1,
    "lng": -4.2
  },
  "to": {
    "lat": 49.8,
    "lng": -3.1
  }
}

Ymateb

Mae REST yn amgáu canlyniad y cyfrifiad yn yr amlen lwyddiant safonol. Mae MCP yn dychwelyd yr un data cyfrifo fel allbwn offeryn strwythuredig.

JSON
{
  "ok": true,
  "data": {
    "degrees": 112.54786806700503,
    "compass": "ESE"
  }
}

Sgemâu

Mae'r diffiniadau isod yn dangos y JSON Schema cyflawn a ddefnyddir i ddilysu mewnbynnau a disgrifio allbynnau.

Cynllun mewnbwn

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "from": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "lat": {
          "type": "string",
          "description": "Latitude as decimal degrees or a coordinate string such as 51° 30′ 26.4″ N."
        },
        "lng": {
          "type": "string",
          "description": "Longitude as decimal degrees or a coordinate string such as 0° 07′ 39″ W."
        }
      },
      "required": [
        "lat",
        "lng"
      ]
    },
    "to": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "lat": {
          "type": "string",
          "description": "Latitude as decimal degrees or a coordinate string such as 51° 30′ 26.4″ N."
        },
        "lng": {
          "type": "string",
          "description": "Longitude as decimal degrees or a coordinate string such as 0° 07′ 39″ W."
        }
      },
      "required": [
        "lat",
        "lng"
      ]
    }
  },
  "required": [
    "from",
    "to"
  ]
}

Cynllun allbwn

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "degrees": {
      "type": "number"
    },
    "compass": {
      "type": "string"
    }
  },
  "required": [
    "degrees",
    "compass"
  ]
}
Dogfennaeth API & MCP