From ffc8f41bda1a9d89ddb886028e55be2893f6ef2f Mon Sep 17 00:00:00 2001 From: Don Cross Date: Sat, 28 Oct 2023 16:44:57 -0400 Subject: [PATCH] Go: added function RotationGalEqj --- generate/template/astronomy.go | 20 ++++++++++++++++++++ source/golang/README.md | 16 +++++++++++++--- source/golang/astronomy.go | 20 ++++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/generate/template/astronomy.go b/generate/template/astronomy.go index 78fb0d52..57d81d0c 100644 --- a/generate/template/astronomy.go +++ b/generate/template/astronomy.go @@ -1552,6 +1552,26 @@ func RotationEqjGal() RotationMatrix { return r } +func RotationGalEqj() RotationMatrix { + r := RotationMatrix{} + + // This rotation matrix was calculated by the following script + // in this same source code repository: + // demo/python/galeqj_matrix.py + + r.Rot[0][0] = -0.0548624779711344 + r.Rot[0][1] = -0.8734572784246782 + r.Rot[0][2] = -0.4838000529948520 + r.Rot[1][0] = +0.4941095946388765 + r.Rot[1][1] = -0.4447938112296831 + r.Rot[1][2] = +0.7470034631630423 + r.Rot[2][0] = -0.8676668813529025 + r.Rot[2][1] = -0.1980677870294097 + r.Rot[2][2] = +0.4559861124470794 + + return r +} + type addSolTerm struct { coeffl float64 coeffs float64 diff --git a/source/golang/README.md b/source/golang/README.md index 699f3036..73a6a430 100644 --- a/source/golang/README.md +++ b/source/golang/README.md @@ -61,6 +61,7 @@ It provides a suite of well\-tested functions for calculating positions of the S - [func RotationEqdEqj\(time \*AstroTime\) RotationMatrix](<#RotationEqdEqj>) - [func RotationEqjEcl\(\) RotationMatrix](<#RotationEqjEcl>) - [func RotationEqjGal\(\) RotationMatrix](<#RotationEqjGal>) + - [func RotationGalEqj\(\) RotationMatrix](<#RotationGalEqj>) - [type SearchContext](<#SearchContext>) - [type SeasonsInfo](<#SeasonsInfo>) - [type Spherical](<#Spherical>) @@ -384,7 +385,7 @@ type AstroVector struct { ``` -### func [GeoMoon]() +### func [GeoMoon]() ```go func GeoMoon(time AstroTime) AstroVector @@ -540,7 +541,7 @@ type JupiterMoonsInfo struct { ``` -### func [JupiterMoons]() +### func [JupiterMoons]() ```go func JupiterMoons(time AstroTime) JupiterMoonsInfo @@ -700,8 +701,17 @@ func RotationEqjGal() RotationMatrix Calculates a rotation matrix from J2000 mean equator \(EQJ\) to galactic \(GAL\). + +### func [RotationGalEqj]() + +```go +func RotationGalEqj() RotationMatrix +``` + + + -## type [SearchContext]() +## type [SearchContext]() diff --git a/source/golang/astronomy.go b/source/golang/astronomy.go index 584c3b68..a0837dd3 100644 --- a/source/golang/astronomy.go +++ b/source/golang/astronomy.go @@ -1552,6 +1552,26 @@ func RotationEqjGal() RotationMatrix { return r } +func RotationGalEqj() RotationMatrix { + r := RotationMatrix{} + + // This rotation matrix was calculated by the following script + // in this same source code repository: + // demo/python/galeqj_matrix.py + + r.Rot[0][0] = -0.0548624779711344 + r.Rot[0][1] = -0.8734572784246782 + r.Rot[0][2] = -0.4838000529948520 + r.Rot[1][0] = +0.4941095946388765 + r.Rot[1][1] = -0.4447938112296831 + r.Rot[1][2] = +0.7470034631630423 + r.Rot[2][0] = -0.8676668813529025 + r.Rot[2][1] = -0.1980677870294097 + r.Rot[2][2] = +0.4559861124470794 + + return r +} + type addSolTerm struct { coeffl float64 coeffs float64