Skip to content

Navigation Menu

Sign in
Sign up

feat: add WGS84 geocentric radius with refraction-corrected dip - #282

Open
msheby wants to merge 1 commit into
KosherJava:master from
msheby:feature/wgs84-geocentric-radius-v2
Open

feat: add WGS84 geocentric radius with refraction-corrected dip #282
msheby wants to merge 1 commit into
KosherJava:master from
msheby:feature/wgs84-geocentric-radius-v2

Conversation

@msheby

@msheby msheby commented Jun 26, 2026

Copy link
Copy Markdown

Adds latitude-aware dip calculation to AstronomicalCalculator using the exact WGS84 ellipsoid formula and atmospheric refraction coefficient k.

New API:

  • getGeocentricRadius(double latitude): exact WGS84 surface radius R(φ)
  • getElevationAdjustment(double elevation, double latitude): 2-arg overload
  • getElevationAdjustment(double observerElevation, double horizonElevation, double latitude): 3-arg overload with elevated-horizon support
  • adjustZenith(double, double, double, LocalDate): 4-arg overload
  • adjustZenith(double, double, double, double, LocalDate): 5-arg overload
  • getRefractionCoefficient() / setRefractionCoefficient(double): accessor pair for atmospheric refraction coefficient (default 0.17, range [0, 1))

Dip formula: acos(R_eff / (R_eff + h_km)) where R_eff = R(φ) / (1 - k). Sub-horizon clamping (observerElevation < horizonElevation) returns 0°; exact computation of a raised-horizon angle requires terrain distance, which is not available in this API.

All four subclasses (NOAACalculator, MeeusCalculator, SPACalculator, SunTimesCalculator) updated to pass latitude to the new 4-arg adjustZenith. equals/hashCode updated to include refractionCoefficient.

BREAKING CHANGE: getEarthRadius(), setEarthRadius(double), getElevationAdjustment(double), and adjustZenith(double, double, LocalDate) have been removed. Use getElevationAdjustment(double, double) and adjustZenith(double, double, double, LocalDate) instead.

Adds latitude-aware dip calculation to AstronomicalCalculator using the
exact WGS84 ellipsoid formula and atmospheric refraction coefficient k.
New API:
- getGeocentricRadius(double latitude): exact WGS84 surface radius R(φ)
- getElevationAdjustment(double elevation, double latitude): 2-arg overload
- getElevationAdjustment(double observerElevation, double horizonElevation,
 double latitude): 3-arg overload with elevated-horizon support
- adjustZenith(double, double, double, LocalDate): 4-arg overload
- adjustZenith(double, double, double, double, LocalDate): 5-arg overload
- getRefractionCoefficient() / setRefractionCoefficient(double): accessor
 pair for atmospheric refraction coefficient (default 0.17, range [0, 1))
Dip formula: acos(R_eff / (R_eff + h_km)) where R_eff = R(φ) / (1 - k).
Sub-horizon clamping (observerElevation < horizonElevation) returns 0°;
exact computation of a raised-horizon angle requires terrain distance,
which is not available in this API.
All four subclasses (NOAACalculator, MeeusCalculator, SPACalculator,
SunTimesCalculator) updated to pass latitude to the new 4-arg adjustZenith.
equals/hashCode updated to include refractionCoefficient.
BREAKING CHANGE: getEarthRadius(), setEarthRadius(double),
getElevationAdjustment(double), and adjustZenith(double, double, LocalDate)
have been removed. Use getElevationAdjustment(double, double) and
adjustZenith(double, double, double, LocalDate) instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /