mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-24 08:45:55 -04:00
Kotlin: rotationEqdEcl, rotationEclEqd.
This commit is contained in:
@@ -4271,6 +4271,41 @@ object Astronomy {
|
||||
*/
|
||||
fun rotationEqjHor(time: AstroTime, observer: Observer): RotationMatrix =
|
||||
rotationHorEqj(time, observer).inverse()
|
||||
|
||||
/**
|
||||
* Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL).
|
||||
*
|
||||
* This is one of the family of functions that returns a rotation matrix
|
||||
* for converting from one orientation to another.
|
||||
* Source: EQD = equatorial system, using equator of date.
|
||||
* Target: ECL = ecliptic system, using equator at J2000 epoch.
|
||||
*
|
||||
* @param time
|
||||
* The date and time of the source equator.
|
||||
*
|
||||
* @returns
|
||||
* A rotation matrix that converts EQD to ECL.
|
||||
*/
|
||||
fun rotationEqdEcl(time: AstroTime): RotationMatrix =
|
||||
rotationEqdEqj(time) combine
|
||||
rotationEqjEcl()
|
||||
|
||||
/**
|
||||
* Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD).
|
||||
*
|
||||
* This is one of the family of functions that returns a rotation matrix
|
||||
* for converting from one orientation to another.
|
||||
* Source: ECL = ecliptic system, using equator at J2000 epoch.
|
||||
* Target: EQD = equatorial system, using equator of date.
|
||||
*
|
||||
* @param time
|
||||
* The date and time of the desired equator.
|
||||
*
|
||||
* @returns
|
||||
* A rotation matrix that converts ECL to EQD.
|
||||
*/
|
||||
fun rotationEclEqd(time: AstroTime): RotationMatrix =
|
||||
rotationEqdEcl(time).inverse()
|
||||
}
|
||||
|
||||
//=======================================================================================
|
||||
|
||||
@@ -26,7 +26,9 @@ The main container of astronomy calculation functions.
|
||||
| [massProduct](mass-product.md) | [jvm]<br>fun [massProduct](mass-product.md)(body: [Body](../-body/index.md)): [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)<br>Returns the product of mass and universal gravitational constant of a Solar System body. |
|
||||
| [refractionAngle](refraction-angle.md) | [jvm]<br>fun [refractionAngle](refraction-angle.md)(refraction: [Refraction](../-refraction/index.md), altitude: [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)): [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)<br>Calculates the amount of "lift" to an altitude angle caused by atmospheric refraction. |
|
||||
| [rotationAxis](rotation-axis.md) | [jvm]<br>fun [rotationAxis](rotation-axis.md)(body: [Body](../-body/index.md), time: [AstroTime](../-astro-time/index.md)): [AxisInfo](../-axis-info/index.md)<br>Calculates information about a body's rotation axis at a given time. |
|
||||
| [rotationEclEqd](rotation-ecl-eqd.md) | [jvm]<br>fun [rotationEclEqd](rotation-ecl-eqd.md)(time: [AstroTime](../-astro-time/index.md)): [RotationMatrix](../-rotation-matrix/index.md)<br>Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD). |
|
||||
| [rotationEclEqj](rotation-ecl-eqj.md) | [jvm]<br>fun [rotationEclEqj](rotation-ecl-eqj.md)(): [RotationMatrix](../-rotation-matrix/index.md)<br>Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial J2000 (EQJ). |
|
||||
| [rotationEqdEcl](rotation-eqd-ecl.md) | [jvm]<br>fun [rotationEqdEcl](rotation-eqd-ecl.md)(time: [AstroTime](../-astro-time/index.md)): [RotationMatrix](../-rotation-matrix/index.md)<br>Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL). |
|
||||
| [rotationEqdEqj](rotation-eqd-eqj.md) | [jvm]<br>fun [rotationEqdEqj](rotation-eqd-eqj.md)(time: [AstroTime](../-astro-time/index.md)): [RotationMatrix](../-rotation-matrix/index.md)<br>Calculates a rotation matrix from equatorial of-date (EQD) to equatorial J2000 (EQJ). |
|
||||
| [rotationEqdHor](rotation-eqd-hor.md) | [jvm]<br>fun [rotationEqdHor](rotation-eqd-hor.md)(time: [AstroTime](../-astro-time/index.md), observer: [Observer](../-observer/index.md)): [RotationMatrix](../-rotation-matrix/index.md)<br>Calculates a rotation matrix from equatorial of-date (EQD) to horizontal (HOR). |
|
||||
| [rotationEqjEcl](rotation-eqj-ecl.md) | [jvm]<br>fun [rotationEqjEcl](rotation-eqj-ecl.md)(): [RotationMatrix](../-rotation-matrix/index.md)<br>Calculates a rotation matrix from equatorial J2000 (EQJ) to ecliptic J2000 (ECL). |
|
||||
|
||||
18
source/kotlin/doc/-astronomy/rotation-ecl-eqd.md
Normal file
18
source/kotlin/doc/-astronomy/rotation-ecl-eqd.md
Normal file
@@ -0,0 +1,18 @@
|
||||
//[astronomy](../../../index.md)/[io.github.cosinekitty.astronomy](../index.md)/[Astronomy](index.md)/[rotationEclEqd](rotation-ecl-eqd.md)
|
||||
|
||||
# rotationEclEqd
|
||||
|
||||
[jvm]\
|
||||
fun [rotationEclEqd](rotation-ecl-eqd.md)(time: [AstroTime](../-astro-time/index.md)): [RotationMatrix](../-rotation-matrix/index.md)
|
||||
|
||||
Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD).
|
||||
|
||||
This is one of the family of functions that returns a rotation matrix for converting from one orientation to another. Source: ECL = ecliptic system, using equator at J2000 epoch. Target: EQD = equatorial system, using equator of date.
|
||||
|
||||
## Parameters
|
||||
|
||||
jvm
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| time | The date and time of the desired equator. |
|
||||
18
source/kotlin/doc/-astronomy/rotation-eqd-ecl.md
Normal file
18
source/kotlin/doc/-astronomy/rotation-eqd-ecl.md
Normal file
@@ -0,0 +1,18 @@
|
||||
//[astronomy](../../../index.md)/[io.github.cosinekitty.astronomy](../index.md)/[Astronomy](index.md)/[rotationEqdEcl](rotation-eqd-ecl.md)
|
||||
|
||||
# rotationEqdEcl
|
||||
|
||||
[jvm]\
|
||||
fun [rotationEqdEcl](rotation-eqd-ecl.md)(time: [AstroTime](../-astro-time/index.md)): [RotationMatrix](../-rotation-matrix/index.md)
|
||||
|
||||
Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL).
|
||||
|
||||
This is one of the family of functions that returns a rotation matrix for converting from one orientation to another. Source: EQD = equatorial system, using equator of date. Target: ECL = ecliptic system, using equator at J2000 epoch.
|
||||
|
||||
## Parameters
|
||||
|
||||
jvm
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| time | The date and time of the source equator. |
|
||||
@@ -4271,6 +4271,41 @@ object Astronomy {
|
||||
*/
|
||||
fun rotationEqjHor(time: AstroTime, observer: Observer): RotationMatrix =
|
||||
rotationHorEqj(time, observer).inverse()
|
||||
|
||||
/**
|
||||
* Calculates a rotation matrix from equatorial of-date (EQD) to ecliptic J2000 (ECL).
|
||||
*
|
||||
* This is one of the family of functions that returns a rotation matrix
|
||||
* for converting from one orientation to another.
|
||||
* Source: EQD = equatorial system, using equator of date.
|
||||
* Target: ECL = ecliptic system, using equator at J2000 epoch.
|
||||
*
|
||||
* @param time
|
||||
* The date and time of the source equator.
|
||||
*
|
||||
* @returns
|
||||
* A rotation matrix that converts EQD to ECL.
|
||||
*/
|
||||
fun rotationEqdEcl(time: AstroTime): RotationMatrix =
|
||||
rotationEqdEqj(time) combine
|
||||
rotationEqjEcl()
|
||||
|
||||
/**
|
||||
* Calculates a rotation matrix from ecliptic J2000 (ECL) to equatorial of-date (EQD).
|
||||
*
|
||||
* This is one of the family of functions that returns a rotation matrix
|
||||
* for converting from one orientation to another.
|
||||
* Source: ECL = ecliptic system, using equator at J2000 epoch.
|
||||
* Target: EQD = equatorial system, using equator of date.
|
||||
*
|
||||
* @param time
|
||||
* The date and time of the desired equator.
|
||||
*
|
||||
* @returns
|
||||
* A rotation matrix that converts ECL to EQD.
|
||||
*/
|
||||
fun rotationEclEqd(time: AstroTime): RotationMatrix =
|
||||
rotationEqdEcl(time).inverse()
|
||||
}
|
||||
|
||||
//=======================================================================================
|
||||
|
||||
@@ -604,6 +604,26 @@ class Tests {
|
||||
),
|
||||
"EQJ HOR"
|
||||
)
|
||||
|
||||
compareMatrices(
|
||||
Astronomy.rotationEqdEcl(time),
|
||||
RotationMatrix(
|
||||
0.9999856608656787, -0.00535518855821894, -4.305530497609837e-06,
|
||||
0.004911515527973243, 0.917457490583079, -0.39780350675706494,
|
||||
0.002134262929010771, 0.39779778145246825, 0.9174706371286464,
|
||||
),
|
||||
"EQD ECL"
|
||||
)
|
||||
|
||||
compareMatrices(
|
||||
Astronomy.rotationEclEqd(time),
|
||||
RotationMatrix(
|
||||
0.9999856608656787, 0.004911515527973243, 0.002134262929010771,
|
||||
-0.00535518855821894, 0.917457490583079, 0.39779778145246825,
|
||||
-4.305530497609837e-06, -0.39780350675706494, 0.9174706371286464,
|
||||
),
|
||||
"ECL EQD"
|
||||
)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user