I'm getting information about the moon's altitude from yr.no's API and they print the altitude as 50.0496753501172.

How can I convert that to kilometers; even if it is already in kilometers?

有帮助吗?

解决方案

The only altitude I see in the API response (below) is nested under the <sun> element, not <moon>. The API documentation you linked to refers to it as:

The angle to the sun at solar noon is also given.

So what this <noon altitude="50.0496753501172" /> really means is that, at noon, the sun will be about 50 degrees above the horizon. That's it. Nothing to do with the moon, nothing to do with distance.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top