mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-19 14:27:52 -04:00
Kotlin: lunar libration. Fixes for other languages.
The existing lunar libration functions in the other languages (C, C#, Python, JavaScript) were calculating the Moon's ecliptic latitude and longitude in radians, not degrees as intended. They have been fixed. Implemented the libration function for Kotlin.
This commit is contained in:
@@ -523,8 +523,8 @@ for a given moment in time. See [`Libration`](#Libration) for more details.
|
||||
| --- | --- | --- |
|
||||
| `float` | `elat` | Sub-Earth libration ecliptic latitude angle, in degrees. |
|
||||
| `float` | `elon` | Sub-Earth libration ecliptic longitude angle, in degrees. |
|
||||
| `float` | `mlat` | Moon's geocentric ecliptic latitude. |
|
||||
| `float` | `mlon` | Moon's geocentric ecliptic longitude. |
|
||||
| `float` | `mlat` | Moon's geocentric ecliptic latitude, in degrees. |
|
||||
| `float` | `mlon` | Moon's geocentric ecliptic longitude, in degrees. |
|
||||
| `float` | `dist_km` | Distance between the centers of the Earth and Moon in kilometers. |
|
||||
| `float` | `diam_deg` | The apparent angular diameter of the Moon as seen from the center of the Earth. |
|
||||
|
||||
|
||||
@@ -9136,9 +9136,9 @@ class LibrationInfo:
|
||||
elon : float
|
||||
Sub-Earth libration ecliptic longitude angle, in degrees.
|
||||
mlat : float
|
||||
Moon's geocentric ecliptic latitude.
|
||||
Moon's geocentric ecliptic latitude, in degrees.
|
||||
mlon : float
|
||||
Moon's geocentric ecliptic longitude.
|
||||
Moon's geocentric ecliptic longitude, in degrees.
|
||||
dist_km : float
|
||||
Distance between the centers of the Earth and Moon in kilometers.
|
||||
diam_deg : float
|
||||
@@ -9284,7 +9284,7 @@ def Libration(time):
|
||||
ldash2 = -tau + (rho*math.cos(a) + sigma*math.sin(a))*math.tan(bdash)
|
||||
bdash = math.degrees(bdash)
|
||||
bdash2 = sigma*math.cos(a) - rho*math.sin(a)
|
||||
return LibrationInfo(bdash + bdash2, ldash + ldash2, mlat, mlon, dist_km, diam_deg)
|
||||
return LibrationInfo(bdash + bdash2, ldash + ldash2, math.degrees(mlat), math.degrees(mlon), dist_km, diam_deg)
|
||||
|
||||
|
||||
class AxisInfo:
|
||||
|
||||
Reference in New Issue
Block a user