منصة المطورين Mariner GPS Tools
حساب الاتجاه الحقيقي الابتدائي
حساب الاتجاه الابتدائي بين نقطتين
واجهات
POST
نقطة النهاية REST
/api/v1/bearingMCP
اسم الأداة
calculate_bearingطلب
أرسل الطلب كـ JSON. يقوم عملاء MCP بتمرير نفس الحقول كوسيطات الأداة.
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
}
}'هيئة الطلبjson
{
"from": {
"lat": 50.1,
"lng": -4.2
},
"to": {
"lat": 49.8,
"lng": -3.1
}
}الاستجابة
يقوم REST بتغليف نتيجة الحساب في مظروف النجاح القياسي. تقوم MCP بإرجاع نفس بيانات الحساب مثل مخرجات الأداة المنظمة.
JSON
{
"ok": true,
"data": {
"degrees": 112.54786806700503,
"compass": "ESE"
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}المخططات
توضح التعريفات أدناه مخطط JSON الكامل المستخدم للتحقق من صحة المدخلات ووصف المخرجات.
مخطط الإدخال
{
"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"
]
}مخطط الإخراج
{
"type": "object",
"additionalProperties": false,
"properties": {
"degrees": {
"type": "number"
},
"compass": {
"type": "string"
}
},
"required": [
"degrees",
"compass"
]
}