Commit Graph

8 Commits

Author SHA1 Message Date
Don Cross
737fb01384 Kotlin docs: remove unwanted enum constructors.
This is a workaround for a Dokka GFM issue I reported:
https://github.com/Kotlin/dokka/issues/2468

I updated the format_kotlin_doc.py script to
remove the internal constructor calls for members of the Body enum.
2022-04-25 16:20:18 -04:00
Don Cross
5708ae36a6 Process Kotlin documentation to fix dokka issues.
The dokkaGfm tool has a few oddities I don't like.
I updated my format_kotlin_doc.py script to work around
a couple of them:

1. Strip out all the noisy [jvm] tags it puts everywhere.

2. Remove the unhelpful and incorrect `Properties` sections
   it adds to all my enum classes and enum members.

I will come back and address other issues later.
2022-04-25 12:56:35 -04:00
Don Cross
a6e72a2423 Kotlin: search for lunar nodes.
Search for times when the Moon ascends or descends
through the ecliptic plane. These are called
ascending and descending nodes. Added the functions:

    searchMoonNode
    nextMoonNode

Also corrected comments in the unit tests that
incorrectly stated nodes occur when the ecliptic
longitude is zero. They should have said the
ecliptic latitude is zero.
2022-04-23 20:34:52 -04:00
Don Cross
16578935ad Kotlin: implemented relative longitude search.
Implemented searchRelativeLongitude, which finds
planetary conjunctions and oppositions.
Discovered I can make all languages' unit tests
more strict: 6.8 minute error tolerance instead of 15.

Fixed documentation mistake in C# function SearchRelativeLongitude:
the function cannot return null. It either finds a solution time
or throws an exception.

Simplified Kotlin unit tests: use a more compact pattern of
scanning space-delimited tokens in lines.
2022-04-17 12:22:07 -04:00
Don Cross
832fec5ce7 Kotlin: simplified per-body mass product and VSOP87 models.
Thanks to @ebraminio, I learned that Kotlin enum classes
allow the members to contain data properties. This greatly
simplifies code so that I no longer need such verbose
`when (body)` statements.

I also understand Kotlin enums better, and I realized
there is no need for `Body.Invalid`, because the compiler
simply does not allow invalid enum values to exist.
In any future hypothetical situation where I want to
represent an optional `Body` value, I can use the nullable type `Body?`.
2022-03-30 14:22:22 -04:00
Don Cross
8c923d49d6 Kotlin: added more data types.
Ported the following types to the Kotlin code:

    GlobalSolarEclipseInfo
    EclipseEvent
    LocalSolarEclipseInfo
    TransitInfo
    ShadowInfo
    IllumInfo
    AxisInfo
    NodeEventKind
    NodeEventInfo

Made some wording fixes in the documentation for the
other languages.
2022-03-25 15:52:27 -04:00
Don Cross
f0c4eb05db Kotlin: Ported some more data types.
Ecliptic
Topocentric
SeasonsInfo
MoonQuarterInfo
LibrationInfo
HourAngleInfo
ElongationInfo
ApsisKind
ApsisInfo
EclipseKind
LunarEclipseInfo
2022-03-24 20:17:14 -04:00
Don Cross
53c8d7145a Publish generated Kotlin documentation to GitHub.
Merge a custom Markdown prefix with documentation
generated by dokka from Kotlin source code into
the published GitHub page. See the new script:

    generate/kotlindoc/format_kotlin_doc.py

The result is not yet quite what I want, but it
is much better than nothing.

Things to improve:

The `object Astronomy` link should not be hidden
in the middle of the other types. It should be
expanded and promoted to the top level.
2022-03-23 20:36:00 -04:00