Commit Graph

1273 Commits

Author SHA1 Message Date
Don Cross
f0dd5757ac Go: added function VectorFromSphere. 2023-10-30 13:07:52 -04:00
Don Cross
d76235a963 Go: added functions updatePosition, updateVelocity. 2023-10-30 13:04:21 -04:00
Don Cross
6755ba1e15 Go: added function ToggleAzimuthDirection. 2023-10-30 13:00:06 -04:00
Don Cross
d5c572a9ec Go: added function SphereFromVector. 2023-10-30 12:58:05 -04:00
Don Cross
ffc8f41bda Go: added function RotationGalEqj 2023-10-28 16:44:57 -04:00
Don Cross
56a2749147 Go: added function RotationEqjGal 2023-10-28 16:43:05 -04:00
Don Cross
0647a87553 Go: added function RotationEqjEcl. 2023-10-28 16:39:13 -04:00
Don Cross
69e8c352ea Go: added function RotateEclEqj. 2023-10-28 16:36:57 -04:00
Don Cross
e8d9814c4a Go: added datan2, rotateEquatorialToEcliptic. 2023-10-28 16:33:41 -04:00
Don Cross
e7bf4d221a Go: added function RefractionAngle 2023-10-28 16:27:57 -04:00
Don Cross
ba33086a79 Go: added function quadInterp. 2023-10-28 16:12:43 -04:00
Don Cross
5d5db9de0e Go: added function PlanetOrbitalPeriod. 2023-10-28 16:03:58 -04:00
Don Cross
da6bb765fe Go: added Pivot function. 2023-10-28 14:00:05 -04:00
Don Cross
938d63a4d7 Go: added ObserverGravity function. 2023-10-28 13:47:10 -04:00
Don Cross
443ebae626 Go: added function obscuration. 2023-10-28 13:35:39 -04:00
Don Cross
1a7ef4d8e4 Merge branch 'master' into golang 2023-10-27 20:17:33 -04:00
Don Cross
62659b2df2 Go: normalizeLongitude function 2023-10-27 15:35:01 -04:00
Don Cross
58f514f77f Go: moonMagnitude function 2023-10-27 15:32:25 -04:00
Don Cross
3955fbff7b Go: maxAltitudeSlope 2023-10-27 15:27:50 -04:00
Don Cross
7b8ec77061 Go: added function MassProduct. 2023-10-27 14:43:28 -04:00
Don Cross
0e29235023 Go: adding gravitation functions
Added GM data for the Sun and planets.
Added some terse vector arithmetic operations.
Implemented MajorBodies acceleration functions.
Added longitudeOffset function.
2023-10-27 13:42:05 -04:00
Don Cross
9c7dd495b1 Go: added function horizonDipAngle. 2023-10-27 13:15:59 -04:00
Don Cross
2c8b33452c Go: added function findAscent. 2023-10-26 21:34:43 -04:00
Don Cross
a295522e36 Go: added more functions
eclipseKindFromUmbra
clampIndex
2023-10-26 21:06:58 -04:00
Don Cross
9122dc2454 Go: added unit test to verify Jupiter moons calculations. 2023-10-26 17:19:53 -04:00
Don Cross
2c8f9b3c03 Go: added calculation of Jupiter's moons.
Generate tables of numbers for Jupiter's moons.
Implemented Go functions for Jupiter's moons.
2023-10-26 15:19:04 -04:00
Don Cross
4662273d99 Go: fixed Body enum values, implemented isSuperiorPlanet. 2023-10-26 14:06:57 -04:00
Don Cross
e487fa651f Go: added function InverseRotation. 2023-10-26 10:51:19 -04:00
Don Cross
af53f189e8 Go: added function IdentityMatrix. 2023-10-26 10:37:13 -04:00
Don Cross
ba62eea34f Go: added bodyState type and exportState function. 2023-10-26 10:32:15 -04:00
Don Cross
66e40d825f Go: added user-defined stars
Internal type: starDef
Internal array variable: starTable
Functions:

    getStar
    userDefinedStar
    DefineStar
2023-10-26 10:25:16 -04:00
Don Cross
a9179ed22a Go: added nutation, state vector, and rotation matrix functions.
Added the following functions to Go:

    nutationRot
    nutation
    nutationPosVel
    RotateState
    CombineRotation
    RotationEqdEqj
2023-10-25 17:26:30 -04:00
Don Cross
c850481306 Go: added calcShadow and vector dot product. 2023-10-25 16:44:39 -04:00
Don Cross
1d19e211c3 Fixed #323 - checks time pointers for NULL.
Prevents crashes due to dereferencing NULL time pointers.
Passing in NULL for a `time` pointer will no longer cause
a crash in an Astronomy Engine function.

Wherever possible, a NULL time pointer will result in a
status code `ASTRO_INVALID_PARAMETER`.

`Astronomy_Horizon` has no way to report a status code,
so a null pointer causes it to return all NAN values.
Perhaps it should return a status code (considering for separate commit).

Thanks to [Steven Booth](https://github.com/sbooth) for suggesting this!
2023-10-23 19:50:01 -04:00
Don Cross
e393349b4e Go: SiderealTime
Fixed a bug in the Earth Tilt function etilt.
Implemented the SiderealTime function.
2023-10-08 15:38:51 -04:00
Don Cross
774b636dac Go: iau2000b, etilt, era.
More low-level functions necessary to calculating Earth orientation.
iau2000b calculates nutation angles.
etilt calculates overall axial tilt of the Earth.
era calculates the Earth Rotation Angle.
2023-10-08 09:56:42 -04:00
Don Cross
6cc0b8cfb0 Go: Atmosphere function 2023-10-07 20:27:00 -04:00
Don Cross
2393bb327e Go: GeoMoon calculates the Moon's geocentric position. 2023-10-07 15:05:12 -04:00
Don Cross
1b53dd60ac Go: added more functions
I'm working toward implementing the GeoMoon function.
I added the following, which are all required to get to that point.

meanObliq
eclOblToEquVec
eclToEquVec
precessionRot
precession
RotateVector
2023-10-06 21:12:44 -04:00
Don Cross
9a500abe2a Go: added functions DaysFromCalendar, TimeFromCalendar. Also added more documentation. 2023-10-06 20:32:34 -04:00
Don Cross
e38e7d5e25 Go: added function CalendarFromDays.
Added the function CalendarFromDays, which converts a UT value to
a calendar date and time.

Added script `rungo` which is a shortcut for compiling and testing
changes to the Go source code template.
2023-10-06 14:01:05 -04:00
Don Cross
d9cb9d6ed2 Go: added some vector and angle functions.
Added functions:
    DegreesFromRadians
    RadiansFromDegrees
    AngleBetween
    StateVector.Position
    StateVector.Velocity

Changed existing functions to pass structs by value,
just like we do in the C code. This is a safety feature
to signal value semantics and a contract not to mutate the
argument state.

Run Go tests with the -v option to log more info about what's happening.
2023-10-05 21:28:11 -04:00
Don Cross
4941fbb5de Go: generate constellation tables. 2023-10-04 22:02:00 -04:00
Don Cross
92dd08e4c4 Add Go to the front-page table of supported languages.
Added SVG logo for Go.
Added a table entry for Go examples, source, and documentation.
Sorted the language list in alphabetical order: moved Python last.
2023-10-04 19:44:18 -04:00
Don Cross
0df81a7ff6 Specify explicit paths for gomarkdoc.
I need gomarkdoc to generate identical output whether
I run it locally or in GitHub Actions, to verify that the
build process is working correctly. Hopefully these options
will do the trick.
2023-10-04 16:27:31 -04:00
Don Cross
21001da8c1 Use gomarkdoc to generate Markdown documentation for the Go source. 2023-10-04 15:05:20 -04:00
Don Cross
cebe749c2a Go: reworking documentation comments in Go Doc format.
Following the standard comment format for documentation
comments in Go:

https://go.dev/doc/comment

Later we will figure out how to generate online documentation
from these comments.
2023-10-04 12:48:54 -04:00
Don Cross
b9c5bcbda2 Go: implemented AddDays function. 2023-10-03 21:49:12 -04:00
Don Cross
9756c1ebe0 Go: use standard naming conventions, remove "status" fields.
In Go, all symbols should use PascalCase or camelCase.
Go programmers dislike ALL_UPPER_CASE_WITH_UNDERSCORES.
Use PascalCase for exported/public symbols, camelCase for internal/private symbols.

In general, we should follow the Go Style Guide:
https://google.github.io/styleguide/go/index

I recommend we more closely follow the implementation of the C# code
than the C code for figuring out how to name things.
The C# version of Astronomy Engine is a better reference because
Go allows quasi-object-oriented syntax and uses a similar preferred naming style.

We will use idiomatic error reporting and handling, as described here:
https://go.dev/blog/error-handling-and-go
I removed the "status" fields from all the structs, and deleted
the enumerated type astroStatus. I will add a custom error type later,
and report human-readable error messages as is preferred by Go programmers.
2023-10-01 11:44:23 -04:00
Don Cross
d6565550ac Add unit test framework for Go. 2023-09-30 19:15:17 -04:00