Skip to main content
Glama
es3154
by es3154

unit_conversion_lengthToDegrees

Convert ground distance measurements to angular degrees for geographic coordinate calculations using Earth's radius. Supports miles, kilometers, meters, yards, feet, and inches.

Instructions

将长度转换为角度距离。

此功能将地面距离转换为对应的角度距离(基于地球半径)。

Args: distance: 距离值 - 类型: float - 描述: 要转换的距离数值 - 示例: 100.0

units: 距离单位 - 类型: str - 描述: 输入距离的单位 - 有效值: 'miles', 'nauticalmiles', 'kilometers', 'meters', 'yards', 'feet', 'inches' - 默认: 'kilometers' - 示例: 'kilometers'

Returns: str: JSON 字符串格式的角度结果 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 角度数值, "units": "degrees"} - 示例: '{"value": 0.9, "units": "degrees"}'

Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常

Example: >>> import asyncio >>> result = asyncio.run(lengthToDegrees(100.0, 'kilometers')) >>> print(result) '{"value": 0.9, "units": "degrees"}'

Notes: - 基于地球半径计算角度距离 - 转换公式: 角度 = 距离 / (地球半径 × π / 180) - 常用于地理坐标计算 - 依赖于 Turf.js 库和 Node.js 环境

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
distanceYes
unitsNokilometers

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/es3154/turf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server