From 2dd4fc1ab439a30feb9cd813092cf3a31984f9e3 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Wed, 7 Dec 2022 13:03:38 -0500 Subject: [PATCH] Python: rotations for ECT/EQD. --- demo/python/astronomy.py | 57 ++++++++++++++++++++++++ generate/csdown/csharp_prefix.md | 28 ++++++------ generate/hydrogen/c_prefix.md | 32 +++++++------- generate/jsdoc2md/js.hbs | 28 ++++++------ generate/kotlindoc/kotlin_prefix.md | 4 +- generate/pydown/py_prefix.md | 28 ++++++------ generate/template/astronomy.py | 57 ++++++++++++++++++++++++ generate/test.py | 33 +++++++++++++- source/c/README.md | 32 +++++++------- source/csharp/README.md | 28 ++++++------ source/js/README.md | 28 ++++++------ source/kotlin/README.md | 4 +- source/python/README.md | 66 ++++++++++++++++++++++------ source/python/astronomy/astronomy.py | 57 ++++++++++++++++++++++++ 14 files changed, 363 insertions(+), 119 deletions(-) diff --git a/demo/python/astronomy.py b/demo/python/astronomy.py index cf41d900..b7a2c593 100644 --- a/demo/python/astronomy.py +++ b/demo/python/astronomy.py @@ -7596,6 +7596,63 @@ def Rotation_GAL_EQJ(): [-0.8676668813529025, -0.1980677870294097, +0.4559861124470794] ]) +def Rotation_ECT_EQD(time): + """Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). + + This is one of the family of functions that returns a rotation matrix + for converting from one orientation to another. + Source: ECT = true ecliptic of date. + Target: EQD = equator of date. + + Parameters + ---------- + time : Time + The date and time of the ecliptic/equator conversion. + + Returns + ------- + RotationMatrix + A rotation matrix that converts ECT to EQD. + """ + et = _e_tilt(time) + tobl = math.radians(et.tobl) + c = math.cos(tobl) + s = math.sin(tobl) + return RotationMatrix([ + [1.0, 0.0, 0.0], + [0.0, +c, +s], + [0.0, -s, +c] + ]) + +def Rotation_EQD_ECT(time): + """Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). + + This is one of the family of functions that returns a rotation matrix + for converting from one orientation to another. + Source: EQD = equator of date. + Target: ECT = true ecliptic of date. + + Parameters + ---------- + time : Time + The date and time of the equator/ecliptic conversion. + + Returns + ------- + RotationMatrix + A rotation matrix that converts EQD to ECT. + """ + et = _e_tilt(time) + tobl = math.radians(et.tobl) + c = math.cos(tobl) + s = math.sin(tobl) + return RotationMatrix([ + [1.0, 0.0, 0.0], + [0.0, +c, -s], + [0.0, +s, +c] + ]) + + class ConstellationInfo: """Reports the constellation that a given celestial point lies within. diff --git a/generate/csdown/csharp_prefix.md b/generate/csdown/csharp_prefix.md index def68297..95f37fd4 100644 --- a/generate/csdown/csharp_prefix.md +++ b/generate/csdown/csharp_prefix.md @@ -128,10 +128,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -147,22 +147,22 @@ these are used in function and type names. | [EquatorFromVector](#Astronomy.EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#Astronomy.VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#Astronomy.HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Astronomy.Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECT](#Astronomy.Rotation_EQD_ECT) | Calculates a rotation matrix from equatorial of date (EQD) to true ecliptic of date (ECT). | -| [Rotation_EQD_ECL](#Astronomy.Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Astronomy.Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Astronomy.Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of date (EQD). | -| [Rotation_EQJ_ECL](#Astronomy.Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Astronomy.Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | +| [Rotation_EQD_EQJ](#Astronomy.Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECT](#Astronomy.Rotation_EQD_ECT) | Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). | +| [Rotation_EQD_ECL](#Astronomy.Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Astronomy.Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Astronomy.Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Astronomy.Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Astronomy.Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | | [Rotation_ECT_EQD](#Astronomy.Rotation_ECT_EQD) | Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). | -| [Rotation_ECL_EQD](#Astronomy.Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of date (EQD). | -| [Rotation_ECL_EQJ](#Astronomy.Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_ECL_EQD](#Astronomy.Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Astronomy.Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Astronomy.Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Astronomy.Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of date (EQD). | +| [Rotation_HOR_EQD](#Astronomy.Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | | [Rotation_HOR_EQJ](#Astronomy.Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | | [Rotation_HOR_ECL](#Astronomy.Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Astronomy.Rotation_EQJ_GAL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Astronomy.Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to equatorial J2000 (EQJ). | +| [Rotation_EQJ_GAL](#Astronomy.Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Astronomy.Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies diff --git a/generate/hydrogen/c_prefix.md b/generate/hydrogen/c_prefix.md index d4a82fa5..51dd9a0b 100644 --- a/generate/hydrogen/c_prefix.md +++ b/generate/hydrogen/c_prefix.md @@ -54,7 +54,7 @@ To get started quickly, here are some [examples](../../demo/c/). | [HelioVector](#Astronomy_HelioVector) | Calculates body position vector with respect to the center of the Sun. | | [GeoVector](#Astronomy_GeoVector) | Calculates body position vector with respect to the center of the Earth. | | [Equator](#Astronomy_Equator) | Calculates right ascension and declination. | -| [Ecliptic](#Astronomy_Ecliptic) | Converts J2000 equatorial coordinates to J2000 ecliptic coordinates. | +| [Ecliptic](#Astronomy_Ecliptic) | Converts J2000 mean equator coordinates to J2000 ecliptic coordinates. | | [EclipticLongitude](#Astronomy_EclipticLongitude) | Calculates ecliptic longitude of a body in the J2000 system. | | [Horizon](#Astronomy_Horizon) | Calculates horizontal coordinates (azimuth, altitude) for a given observer on the Earth. | | [PairLongitude](#Astronomy_PairLongitude) | Calculates the difference in apparent ecliptic longitude between two bodies, as seen from the Earth. | @@ -144,10 +144,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -163,22 +163,22 @@ these are used in function and type names. | [EquatorFromVector](#Astronomy_EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#Astronomy_VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#Astronomy_HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Astronomy_Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECT](#Astronomy_Rotation_EQD_ECT) | Calculates a rotation matrix from equatorial of date (EQD) to true ecliptic of date (ECT). | -| [Rotation_EQD_ECL](#Astronomy_Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Astronomy_Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Astronomy_Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of date (EQD). | -| [Rotation_EQJ_ECL](#Astronomy_Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Astronomy_Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | +| [Rotation_EQD_EQJ](#Astronomy_Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECT](#Astronomy_Rotation_EQD_ECT) | Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). | +| [Rotation_EQD_ECL](#Astronomy_Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Astronomy_Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Astronomy_Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Astronomy_Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Astronomy_Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | | [Rotation_ECT_EQD](#Astronomy_Rotation_ECT_EQD) | Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). | -| [Rotation_ECL_EQD](#Astronomy_Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of date (EQD). | -| [Rotation_ECL_EQJ](#Astronomy_Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_ECL_EQD](#Astronomy_Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Astronomy_Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Astronomy_Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Astronomy_Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of date (EQD). | -| [Rotation_HOR_EQJ](#Astronomy_Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | +| [Rotation_HOR_EQD](#Astronomy_Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | +| [Rotation_HOR_EQJ](#Astronomy_Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 mean equator (EQJ). | | [Rotation_HOR_ECL](#Astronomy_Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 equatorial (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from galactic (GAL) to J2000 equatorial (EQJ). | +| [Rotation_EQJ_GAL](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies diff --git a/generate/jsdoc2md/js.hbs b/generate/jsdoc2md/js.hbs index 1c59fc45..c5ce8ec2 100644 --- a/generate/jsdoc2md/js.hbs +++ b/generate/jsdoc2md/js.hbs @@ -124,10 +124,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -143,20 +143,20 @@ these are used in function and type names. | [EquatorFromVector](#EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of-date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of-date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of-date (EQD). | -| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | -| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD). | -| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | +| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of-date (EQD). | -| [Rotation_HOR_EQJ](#Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | +| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | +| [Rotation_HOR_EQJ](#Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 mean equator (EQJ). | | [Rotation_HOR_ECL](#Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to equatorial J2000 (EQJ). | +| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies diff --git a/generate/kotlindoc/kotlin_prefix.md b/generate/kotlindoc/kotlin_prefix.md index 4ae331fe..40d97e2c 100644 --- a/generate/kotlindoc/kotlin_prefix.md +++ b/generate/kotlindoc/kotlin_prefix.md @@ -52,10 +52,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. diff --git a/generate/pydown/py_prefix.md b/generate/pydown/py_prefix.md index fd5c5289..a1c95136 100644 --- a/generate/pydown/py_prefix.md +++ b/generate/pydown/py_prefix.md @@ -141,10 +141,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -160,20 +160,22 @@ these are used in function and type names. | [EquatorFromVector](#EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of-date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of-date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of-date (EQD). | -| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | -| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD). | -| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECT](#Rotation_EQD_ECT) | Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). | +| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | +| [Rotation_ECT_EQD](#Rotation_ECT_EQD) | Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). | +| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of-date (EQD). | +| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | | [Rotation_HOR_EQJ](#Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | | [Rotation_HOR_ECL](#Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to equatorial J2000 (EQJ). | +| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies diff --git a/generate/template/astronomy.py b/generate/template/astronomy.py index ff4b7109..b1d1b371 100644 --- a/generate/template/astronomy.py +++ b/generate/template/astronomy.py @@ -6090,6 +6090,63 @@ def Rotation_GAL_EQJ(): [-0.8676668813529025, -0.1980677870294097, +0.4559861124470794] ]) +def Rotation_ECT_EQD(time): + """Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). + + This is one of the family of functions that returns a rotation matrix + for converting from one orientation to another. + Source: ECT = true ecliptic of date. + Target: EQD = equator of date. + + Parameters + ---------- + time : Time + The date and time of the ecliptic/equator conversion. + + Returns + ------- + RotationMatrix + A rotation matrix that converts ECT to EQD. + """ + et = _e_tilt(time) + tobl = math.radians(et.tobl) + c = math.cos(tobl) + s = math.sin(tobl) + return RotationMatrix([ + [1.0, 0.0, 0.0], + [0.0, +c, +s], + [0.0, -s, +c] + ]) + +def Rotation_EQD_ECT(time): + """Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). + + This is one of the family of functions that returns a rotation matrix + for converting from one orientation to another. + Source: EQD = equator of date. + Target: ECT = true ecliptic of date. + + Parameters + ---------- + time : Time + The date and time of the equator/ecliptic conversion. + + Returns + ------- + RotationMatrix + A rotation matrix that converts EQD to ECT. + """ + et = _e_tilt(time) + tobl = math.radians(et.tobl) + c = math.cos(tobl) + s = math.sin(tobl) + return RotationMatrix([ + [1.0, 0.0, 0.0], + [0.0, +c, -s], + [0.0, +s, +c] + ]) + + class ConstellationInfo: """Reports the constellation that a given celestial point lies within. diff --git a/generate/test.py b/generate/test.py index fbe6f66c..2cfb2191 100755 --- a/generate/test.py +++ b/generate/test.py @@ -1180,6 +1180,11 @@ def Test_RotRoundTrip(): ecl_hor = astronomy.Rotation_ECL_HOR(time, observer) CheckInverse('hor_ecl', 'ecl_hor', hor_ecl, ecl_hor) + # Round trip #7: EQJ <==> ECT + eqd_ect = astronomy.Rotation_EQD_ECT(time) + ect_eqd = astronomy.Rotation_ECT_EQD(time) + CheckInverse('eqd_ect', 'ect_eqd', eqd_ect, ect_eqd) + # Verify that combining different sequences of rotations result # in the expected combination. # For example, (EQJ ==> HOR ==> ECL) must be the same matrix as (EQJ ==> ECL). @@ -1231,7 +1236,32 @@ def Rotation_Pivot(): Debug('PY Rotation_Pivot: PASS') - +def Test_EQD_ECT(): + time = astronomy.Time.Make(1900, 1, 1, 0, 0, 0.0) + stopTime = astronomy.Time.Make(2100, 1, 1, 0, 0, 0.0) + count = 0 + max_diff = 0.0 + while time.ut <= stopTime.ut: + # Get Moon's geocentric position in EQJ. + eqj = astronomy.GeoMoon(time) + # Convert EQJ to EQD. + eqj_eqd = astronomy.Rotation_EQJ_EQD(time) + eqd = astronomy.RotateVector(eqj_eqd, eqj) + # Convert EQD to ECT. + eqd_ect = astronomy.Rotation_EQD_ECT(time) + ect = astronomy.RotateVector(eqd_ect, eqd) + # Independently get the Moon's spherical coordinates in ECT. + sphere = astronomy.EclipticGeoMoon(time) + # Convert spherical coordinates to ECT vector. + check_ect = astronomy.VectorFromSphere(sphere, time) + # Verify the two ECT vectors are identical, within tolerance. + max_diff = max(max_diff, VectorDiff(ect, check_ect)) + time = time.AddDays(10.0) + count += 1 + if max_diff > 3.743e-18: + print('PY Test_EQD_ECT: excessive vector diff = {:0.6e} au.'.format(max_diff)) + sys.exit(1) + Debug('PY Test_EQD_ECT: PASS: count = {}, max_diff = {:0.6e} au.'.format(count, max_diff)) def Rotation(): Rotation_MatrixInverse() @@ -1249,6 +1279,7 @@ def Rotation(): Test_EQD_HOR(astronomy.Body.Mars) Test_EQD_HOR(astronomy.Body.Jupiter) Test_EQD_HOR(astronomy.Body.Saturn) + Test_EQD_ECT() Test_RotRoundTrip() print('PY Rotation: PASS') return 0 diff --git a/source/c/README.md b/source/c/README.md index fa22f2ac..410c0bf6 100644 --- a/source/c/README.md +++ b/source/c/README.md @@ -54,7 +54,7 @@ To get started quickly, here are some [examples](../../demo/c/). | [HelioVector](#Astronomy_HelioVector) | Calculates body position vector with respect to the center of the Sun. | | [GeoVector](#Astronomy_GeoVector) | Calculates body position vector with respect to the center of the Earth. | | [Equator](#Astronomy_Equator) | Calculates right ascension and declination. | -| [Ecliptic](#Astronomy_Ecliptic) | Converts J2000 equatorial coordinates to J2000 ecliptic coordinates. | +| [Ecliptic](#Astronomy_Ecliptic) | Converts J2000 mean equator coordinates to J2000 ecliptic coordinates. | | [EclipticLongitude](#Astronomy_EclipticLongitude) | Calculates ecliptic longitude of a body in the J2000 system. | | [Horizon](#Astronomy_Horizon) | Calculates horizontal coordinates (azimuth, altitude) for a given observer on the Earth. | | [PairLongitude](#Astronomy_PairLongitude) | Calculates the difference in apparent ecliptic longitude between two bodies, as seen from the Earth. | @@ -144,10 +144,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -163,22 +163,22 @@ these are used in function and type names. | [EquatorFromVector](#Astronomy_EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#Astronomy_VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#Astronomy_HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Astronomy_Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECT](#Astronomy_Rotation_EQD_ECT) | Calculates a rotation matrix from equatorial of date (EQD) to true ecliptic of date (ECT). | -| [Rotation_EQD_ECL](#Astronomy_Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Astronomy_Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Astronomy_Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of date (EQD). | -| [Rotation_EQJ_ECL](#Astronomy_Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Astronomy_Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | +| [Rotation_EQD_EQJ](#Astronomy_Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECT](#Astronomy_Rotation_EQD_ECT) | Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). | +| [Rotation_EQD_ECL](#Astronomy_Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Astronomy_Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Astronomy_Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Astronomy_Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Astronomy_Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | | [Rotation_ECT_EQD](#Astronomy_Rotation_ECT_EQD) | Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). | -| [Rotation_ECL_EQD](#Astronomy_Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of date (EQD). | -| [Rotation_ECL_EQJ](#Astronomy_Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_ECL_EQD](#Astronomy_Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Astronomy_Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Astronomy_Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Astronomy_Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of date (EQD). | -| [Rotation_HOR_EQJ](#Astronomy_Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | +| [Rotation_HOR_EQD](#Astronomy_Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | +| [Rotation_HOR_EQJ](#Astronomy_Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 mean equator (EQJ). | | [Rotation_HOR_ECL](#Astronomy_Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 equatorial (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from galactic (GAL) to J2000 equatorial (EQJ). | +| [Rotation_EQJ_GAL](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Astronomy_Rotation_EQJ_GAL) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies diff --git a/source/csharp/README.md b/source/csharp/README.md index f26f7a6f..8fd75b7e 100644 --- a/source/csharp/README.md +++ b/source/csharp/README.md @@ -128,10 +128,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -147,22 +147,22 @@ these are used in function and type names. | [EquatorFromVector](#Astronomy.EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#Astronomy.VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#Astronomy.HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Astronomy.Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECT](#Astronomy.Rotation_EQD_ECT) | Calculates a rotation matrix from equatorial of date (EQD) to true ecliptic of date (ECT). | -| [Rotation_EQD_ECL](#Astronomy.Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Astronomy.Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Astronomy.Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of date (EQD). | -| [Rotation_EQJ_ECL](#Astronomy.Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Astronomy.Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | +| [Rotation_EQD_EQJ](#Astronomy.Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECT](#Astronomy.Rotation_EQD_ECT) | Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). | +| [Rotation_EQD_ECL](#Astronomy.Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Astronomy.Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Astronomy.Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Astronomy.Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Astronomy.Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | | [Rotation_ECT_EQD](#Astronomy.Rotation_ECT_EQD) | Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). | -| [Rotation_ECL_EQD](#Astronomy.Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of date (EQD). | -| [Rotation_ECL_EQJ](#Astronomy.Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_ECL_EQD](#Astronomy.Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Astronomy.Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Astronomy.Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Astronomy.Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of date (EQD). | +| [Rotation_HOR_EQD](#Astronomy.Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | | [Rotation_HOR_EQJ](#Astronomy.Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | | [Rotation_HOR_ECL](#Astronomy.Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Astronomy.Rotation_EQJ_GAL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Astronomy.Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to equatorial J2000 (EQJ). | +| [Rotation_EQJ_GAL](#Astronomy.Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Astronomy.Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies diff --git a/source/js/README.md b/source/js/README.md index 11bf0749..43d3143f 100644 --- a/source/js/README.md +++ b/source/js/README.md @@ -124,10 +124,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -143,20 +143,20 @@ these are used in function and type names. | [EquatorFromVector](#EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of-date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of-date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of-date (EQD). | -| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | -| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD). | -| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | +| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of-date (EQD). | -| [Rotation_HOR_EQJ](#Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | +| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | +| [Rotation_HOR_EQJ](#Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 mean equator (EQJ). | | [Rotation_HOR_ECL](#Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to equatorial J2000 (EQJ). | +| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies diff --git a/source/kotlin/README.md b/source/kotlin/README.md index 8962a96c..cf096b09 100644 --- a/source/kotlin/README.md +++ b/source/kotlin/README.md @@ -52,10 +52,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. diff --git a/source/python/README.md b/source/python/README.md index 47e36172..f4bfbe73 100644 --- a/source/python/README.md +++ b/source/python/README.md @@ -141,10 +141,10 @@ It also allows converting from a vector to spherical (angular) coordinates and b within a given orientation. Note the 3-letter codes for each of the orientation systems; these are used in function and type names. -- **EQJ = Equatorial J2000**: Uses the Earth's equator on January 1, 2000, at noon UTC. +- **EQJ = J2000 Mean Equator**: Uses the Earth's equator on January 1, 2000, at noon UTC. - **EQD = Equator of Date**: Uses the Earth's equator on a given date and time, adjusted for precession and nutation. - **ECT = True Ecliptic of Date**: Uses the true orbital plane and equator of the Earth on the given date. -- **ECL = Mean J2000 Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. +- **ECL = J2000 Mean Ecliptic**: Uses the plane of the Earth's orbit around the Sun in the year 2000. The x-axis is referenced against the J2000 mean equinox. - **HOR = Horizontal**: Uses the viewpoint of an observer at a specific location on the Earth at a given date and time. - **GAL = Galactic**: Based on the IAU 1958 definition of galactic coordinates. @@ -160,20 +160,22 @@ these are used in function and type names. | [EquatorFromVector](#EquatorFromVector) | Given an equatorial vector, calculates equatorial angular coordinates. | | [VectorFromHorizon](#VectorFromHorizon) | Given apparent angular horizontal coordinates, calculates horizontal vector. | | [HorizonFromVector](#HorizonFromVector) | Given a vector in horizontal orientation, calculates horizontal angular coordinates. | -| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equatorial of-date (EQD) to equatorial J2000 (EQJ). | -| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL). | -| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equatorial of-date (EQD) to horizontal (HOR). | -| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from equatorial J2000 (EQJ) to equatorial of-date (EQD). | -| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from equatorial J2000 (EQJ) to horizontal (HOR). | -| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD). | -| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). | +| [Rotation_EQD_EQJ](#Rotation_EQD_EQJ) | Calculates a rotation matrix from equator of date (EQD) to J2000 mean equator (EQJ). | +| [Rotation_EQD_ECT](#Rotation_EQD_ECT) | Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). | +| [Rotation_EQD_ECL](#Rotation_EQD_ECL) | Calculates a rotation matrix from equator of date (EQD) to ecliptic J2000 (ECL). | +| [Rotation_EQD_HOR](#Rotation_EQD_HOR) | Calculates a rotation matrix from equator of date (EQD) to horizontal (HOR). | +| [Rotation_EQJ_EQD](#Rotation_EQJ_EQD) | Calculates a rotation matrix from J2000 mean equator (EQJ) to equator of date (EQD). | +| [Rotation_EQJ_ECL](#Rotation_EQJ_ECL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to ecliptic J2000 (ECL). | +| [Rotation_EQJ_HOR](#Rotation_EQJ_HOR) | Calculates a rotation matrix from J2000 mean equator (EQJ) to horizontal (HOR). | +| [Rotation_ECT_EQD](#Rotation_ECT_EQD) | Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). | +| [Rotation_ECL_EQD](#Rotation_ECL_EQD) | Calculates a rotation matrix from ecliptic J2000 (ECL) to equator of date (EQD). | +| [Rotation_ECL_EQJ](#Rotation_ECL_EQJ) | Calculates a rotation matrix from ecliptic J2000 (ECL) to J2000 mean equator (EQJ). | | [Rotation_ECL_HOR](#Rotation_ECL_HOR) | Calculates a rotation matrix from ecliptic J2000 (ECL) to horizontal (HOR). | -| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equatorial of-date (EQD). | +| [Rotation_HOR_EQD](#Rotation_HOR_EQD) | Calculates a rotation matrix from horizontal (HOR) to equator of date (EQD). | | [Rotation_HOR_EQJ](#Rotation_HOR_EQJ) | Calculates a rotation matrix from horizontal (HOR) to J2000 equatorial (EQJ). | | [Rotation_HOR_ECL](#Rotation_HOR_ECL) | Calculates a rotation matrix from horizontal (HOR) to ecliptic J2000 (ECL). | -| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from equatorial J2000 (EQJ) to galactic (GAL). | -| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to equatorial J2000 (EQJ). | +| [Rotation_EQJ_GAL](#Rotation_EQJ_GAL) | Calculates a rotation matrix from J2000 mean equator (EQJ) to galactic (GAL). | +| [Rotation_GAL_EQJ](#Rotation_GAL_EQJ) | Calculates a rotation matrix from galactic (GAL) to J2000 mean equator (EQJ). | ### Gravitational simulation of small bodies @@ -2553,6 +2555,25 @@ and so that north represents the direction where azimuth = 0. --- + +### Rotation_ECT_EQD(time) + +**Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD).** + +This is one of the family of functions that returns a rotation matrix +for converting from one orientation to another. +Source: ECT = true ecliptic of date. +Target: EQD = equator of date. + +| Type | Parameter | Description | +| --- | --- | --- | +| [`Time`](#Time) | `time` | The date and time of the ecliptic/equator conversion. | + +**Returns**: [`RotationMatrix`](#RotationMatrix) +A rotation matrix that converts ECT to EQD. + +--- + ### Rotation_EQD_ECL(time) @@ -2572,6 +2593,25 @@ A rotation matrix that converts EQD to ECL. --- + +### Rotation_EQD_ECT(time) + +**Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT).** + +This is one of the family of functions that returns a rotation matrix +for converting from one orientation to another. +Source: EQD = equator of date. +Target: ECT = true ecliptic of date. + +| Type | Parameter | Description | +| --- | --- | --- | +| [`Time`](#Time) | `time` | The date and time of the equator/ecliptic conversion. | + +**Returns**: [`RotationMatrix`](#RotationMatrix) +A rotation matrix that converts EQD to ECT. + +--- + ### Rotation_EQD_EQJ(time) diff --git a/source/python/astronomy/astronomy.py b/source/python/astronomy/astronomy.py index cf41d900..b7a2c593 100644 --- a/source/python/astronomy/astronomy.py +++ b/source/python/astronomy/astronomy.py @@ -7596,6 +7596,63 @@ def Rotation_GAL_EQJ(): [-0.8676668813529025, -0.1980677870294097, +0.4559861124470794] ]) +def Rotation_ECT_EQD(time): + """Calculates a rotation matrix from true ecliptic of date (ECT) to equator of date (EQD). + + This is one of the family of functions that returns a rotation matrix + for converting from one orientation to another. + Source: ECT = true ecliptic of date. + Target: EQD = equator of date. + + Parameters + ---------- + time : Time + The date and time of the ecliptic/equator conversion. + + Returns + ------- + RotationMatrix + A rotation matrix that converts ECT to EQD. + """ + et = _e_tilt(time) + tobl = math.radians(et.tobl) + c = math.cos(tobl) + s = math.sin(tobl) + return RotationMatrix([ + [1.0, 0.0, 0.0], + [0.0, +c, +s], + [0.0, -s, +c] + ]) + +def Rotation_EQD_ECT(time): + """Calculates a rotation matrix from equator of date (EQD) to true ecliptic of date (ECT). + + This is one of the family of functions that returns a rotation matrix + for converting from one orientation to another. + Source: EQD = equator of date. + Target: ECT = true ecliptic of date. + + Parameters + ---------- + time : Time + The date and time of the equator/ecliptic conversion. + + Returns + ------- + RotationMatrix + A rotation matrix that converts EQD to ECT. + """ + et = _e_tilt(time) + tobl = math.radians(et.tobl) + c = math.cos(tobl) + s = math.sin(tobl) + return RotationMatrix([ + [1.0, 0.0, 0.0], + [0.0, +c, -s], + [0.0, +s, +c] + ]) + + class ConstellationInfo: """Reports the constellation that a given celestial point lies within.