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:
Don Cross
2022-04-22 16:36:14 -04:00
parent 554bbf1b00
commit 3ce32f8819
35 changed files with 553 additions and 172 deletions

View File

@@ -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. |

View File

@@ -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: