Skip to content

Missing parallacticAngle property in MoonPosition class #4

@StanleyLubrick

Description

@StanleyLubrick

Hi,

According to the README documentation, the MoonPosition object returned by SunCalc.getMoonPosition() should include a parallacticAngle property:

Returns an object with the following properties:

altitude: moon altitude above the horizon in radians
azimuth: moon azimuth in radians
distance: distance to moon in kilometers
parallacticAngle: parallactic angle of the moon in radians

However, the current implementation of MoonPosition in the codebase only contains three properties:
public class MoonPosition {
public var azimuth: Double
public var altitude: Double
public var distance: Double
// Missing: parallacticAngle
}

Expected behavior:
MoonPosition should include the parallacticAngle property as documented.
Actual behavior:
The property is missing, causing compilation errors when trying to access it as per the documentation.
Use case:
The parallactic angle is needed to calculate the zenith angle of the moon's bright limb. According to the documentation:

By subtracting the parallacticAngle from the angle (from getMoonIllumination) one can get the zenith angle of the moon's bright limb (anticlockwise).

Suggested fix:
Add the parallacticAngle property to MoonPosition and compute it in the getMoonPosition() method, similar to how it's calculated in the original suncalc.js implementation.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions