Commit Graph

2245 Commits

Author SHA1 Message Date
Don Cross
9e98d0fb17 PY: Implemented HourAngle function. 2023-02-12 16:20:33 -05:00
Don Cross
41e05090aa JS: true solar time demo 2023-02-12 15:35:58 -05:00
Don Cross
f11e2e8c6d JS: Implemented HourAngle function. 2023-02-12 14:22:41 -05:00
Don Cross
93fb6226cd C#: Solar time demo using HourAngle(). 2023-02-12 13:32:38 -05:00
Don Cross
43c37c9038 C#: Implemented HourAngle function. 2023-02-12 13:05:29 -05:00
Don Cross
86fde0d5cd C demo: Calculate true solar time from the Sun's hour angle. 2023-02-12 12:03:43 -05:00
Don Cross
6a8a905aa5 C: Implemented Astronomy_HourAngle function.
We already had a function to search for the next time a body
reaches a certain hour angle. But we didn't have a function
to ask what the current hour angle of a body is.
This will resolve that problem, which will also answer
questions about true solar time: use the Sun as the body,
and add 12 to the hour angle, modulo 24.
2023-02-12 10:52:42 -05:00
Don Cross
73f9cb4b0d Another relaxation of test tolerances for the Apple M1 processor. 2023-02-09 10:00:56 -05:00
Don Cross
8bf48d0681 Slight relaxation of test tolerances.
Contributor @ris-tip ran into erroneous test failures
due to tiny floating point calculation differences.
I'm adjusting the thresholds slightly so his tests will pass.
2023-02-09 08:37:39 -05:00
Don Cross
ae467d67df ctest: Finished eliminating hardcoded function names. 2023-02-08 14:26:20 -05:00
Don Cross
67955c2575 ctest.c: More WIP eliminating hardcoded function names. 2023-02-08 11:57:17 -05:00
Don Cross
3777b7f5bb C tests: remove hardcoded function names (WIP). 2023-02-07 15:45:14 -05:00
Don Cross
341a4bbaec Fixed overly general exception in Python code.
Pylint discovered that I was raising Exception,
which was overly general. I didn't mean to do that;
it was supposed to be my custom exception type
astronomy.Error instead. So I fixed that case.

There were also some deprecated settings in the
pylint configuration file, so I fixed those too.
2023-02-07 14:27:06 -05:00
Don Cross
1624ca0890 A quick test to see if __func__ is supported.
It looks like the C unit tests can use __func__ to avoid
hardcoded function names everywhere. I know this is defined
in C++11 and C99, so it should be fine. If it passes unit
testing across all platforms I exercise in GitHub Actions,
I feel comfortable using it, since it will not affect
production code.
2023-02-07 12:27:22 -05:00
Don Cross
667dcf5c9c Fixed #285 - added missing time parameter to docs.
The documentation was missing a mention of
the `time` parameter in the following TypeScript
functions:

* `Rotation_ECT_EQD`
* `Rotation_EQD_ECT`

Likewise, the `time` parameter was not documented in
the corresponding Kotlin functions:

* `rotationEctEqd`
* `rotationEqdEct`

These mistakes have been corrected.
2023-01-28 12:33:12 -05:00
Don Cross
4256903060 Fixed #280 - corrected typo in documentation. 2023-01-23 17:50:13 -05:00
Don Cross
efa5ea7945 Windows build missed a copyright year.
The Windows build does not run the demo tests like
the Linux one does. This resulted in not copying
the updated astronomy.ts to the calendar demo, thus
missing the copyright year update for 2023.
2023-01-07 20:57:23 -05:00
Don Cross
62192357ba Updated copyrights for 2023.
Windows build process now updates copyright
years just like the Linux build process does.
Ran it to update the copyright years for 2023.
2023-01-07 17:13:07 -05:00
dependabot[bot]
67e1968329 Bump json5 from 2.2.0 to 2.2.3 in /generate
Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-07 05:23:00 +00:00
Don Cross
35c587c1bb Added link to functioning Moon Info calculator. 2022-12-30 15:36:24 -05:00
Don Cross
fd4090bd65 Added title 'Astronomy Engine' to README. 2022-12-26 14:20:58 -05:00
Don Cross
2c18257ea8 Updated Astronomy Engine logo. 2022-12-26 14:01:23 -05:00
Don Cross
1a4f842764 Updated Ecliptic to return ECL in all languages. v2.1.13 2022-12-10 19:35:42 -05:00
Don Cross
d4660de2a7 JS: Ecliptic function returns ECT instead of ECL. 2022-12-10 03:55:17 -05:00
Don Cross
47ce0ac34e C#: EquatorialToEcliptic now returns ECT instead of ECL. 2022-12-09 21:03:05 -05:00
Don Cross
f811b6f55b C: Ecliptic function returns ECT instead of ECL.
Now the C function Astronomy_Ecliptic returns ecliptic
coordinates in true equinox of date instead of the
J2000 mean equinox. I'm doing this because it is a
better fit for physical phenomena that ecliptic
coordinates are often used for. For example, lunar nodes,
eclipses, phase angles, and oppositions make more sense
with true latitude and longitude of date.

I will port these changes to the other languages also.
2022-12-09 20:00:52 -05:00
Don Cross
f959599497 Completed EQJ/ECT, ECT/EQJ rotations. 2022-12-09 13:12:42 -05:00
Don Cross
1864fa8539 Orientation nomenclature. C: EQJ/ECT rotations.
More work standardizing the nomenclature of the
orientation systems across all language documents.

Added C functions to calculate rotation matrices
for EQJ/ECT and ECT/EQJ.
2022-12-08 22:03:43 -05:00
Don Cross
281180db24 Use consistent descriptions of EQJ, ECL.
Use consistent wording for these two orientation systems:
EQJ = J2000 mean equator
ECL = J2000 mean ecliptic
2022-12-08 16:16:41 -05:00
Don Cross
b4c36e7188 Merge branch 'master' into ecliptic 2022-12-08 13:44:53 -05:00
Don Cross
30a9b0b757 Fixed warnings from gcc 12.2.
I'm taking gcc 12.2 for a test drive today.
It reports a few warnings that slipped through earlier versions.
None of the warnings concern me for actual code safety,
but I went ahead and resolved them to keep the build clean.

Also provide a hook for a CPP environment variable to override
the C++ compiler to use, instead of forcing g++.
2022-12-08 13:41:12 -05:00
Don Cross
dfbd268aa3 JS: Added rotation ECT/EQD. 2022-12-07 13:48:24 -05:00
Don Cross
2dd4fc1ab4 Python: rotations for ECT/EQD. 2022-12-07 13:03:38 -05:00
Don Cross
1d57802470 Kotlin: implemented EQD/ECT rotations. 2022-12-06 21:12:31 -05:00
Don Cross
78a850daac C# tests: verify EQD/ECT is inverse of ECT/EQD. 2022-12-06 20:09:24 -05:00
Don Cross
8fe8b028f8 Added EQD/ECT rotation functions to C# topic index. 2022-12-06 20:05:46 -05:00
Don Cross
f043ebc62b C#: added rotation matrix functions for EQD/ECT. 2022-12-06 18:36:47 -05:00
Don Cross
541e2774ef C# RotationTest cleanup. 2022-12-06 17:04:22 -05:00
Don Cross
62ba530272 Document new C functions: rotate EQD/ECT. 2022-12-06 15:19:13 -05:00
Don Cross
c102208e2b C: Rotation matrices for EQD/ECT.
Added new C functions to convert back and forth
between Equator of Date (EQD) and True Ecliptic of Date (ECT).
2022-12-06 15:09:00 -05:00
Don Cross
742ab4cbff Define ECT in documentation.
Define ECT = True Ecliptic of Date in the documentation.
I will soon convert the Ecliptic() functions to return ECT instead of
ECL, but I will retain ECL support via rotation matrix functions.
2022-12-06 13:36:47 -05:00
Don Cross
12e68a1931 Fixed warning issued by Microsoft C compiler.
Somehow gcc didn't warn me that a `void` function
was trying to return a `void` value. It makes sense
from a functional language "unit type" perspective,
but it wasn't intentional, and it is weird. Fixed it.
2022-12-05 22:10:51 -05:00
Don Cross
552c7a5557 EclipticGeoMoon uses true equinox of date in all languages.
Added EclipticGeoMoon as output to the temp/*_check.txt files as 'm' lines.
This ensures that all the languages calculate nearly identical values.

Optimized EclipticGeoMoon a little more by eliminating a redundant
call to mean_obliq.
2022-12-05 21:44:35 -05:00
Don Cross
2bdb25227e C EclipticGeoMoon: use true equinox of date.
Updated the C function Astronomy_EclipticGeoMoon to
correct ecliptic coordinates for nutation.
This means that the returned value is expressed in
true equinox of date instead of mean equinox of date.

This results in the moon_ecm test decreasing the max
longitude error from 24 arcseconds to 6 arcseconds.
EclipticGeoMoon is now about 40% slower, but it still
runs in about 0.4 microseconds per call.
2022-12-05 13:55:36 -05:00
Don Cross
b8d195cbca C moon_ecm: handle 360-degree wraparound. More checking. 2022-12-05 11:50:18 -05:00
Don Cross
6b8816b1b5 C tests: make excluded tests more obviously marked. 2022-12-05 11:37:19 -05:00
Don Cross
576eea2245 Unrolled loops from remaining nutation functions. 2022-12-04 21:30:22 -05:00
Don Cross
b9738d9661 C: Unrolled the truncated IAU2000B formula. 2022-12-04 20:56:15 -05:00
Don Cross
b8c0a1f0cc Python: hand-optmized nutation.
I bootstrapped based on the pretty good optimizations that
codegen did for the Python version of the (now truncated)
IAU2000B nutation formula. I will do the same for the other
nutation formulas.
2022-12-04 20:27:44 -05:00
Don Cross
700a834ffc Finally solved my download problems.
I realize now that the URLs I was using to download stuff
from GitHub Actions were redirects. So I need to use 'curl -L'
to follow the redirects. But I also removed the redirect by
using the ultimate URLs.
2022-12-04 19:42:05 -05:00