Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed The Azimuth Value #121

Open
bliss95 opened this issue May 18, 2024 · 0 comments
Open

Fixed The Azimuth Value #121

bliss95 opened this issue May 18, 2024 · 0 comments

Comments

@bliss95
Copy link

bliss95 commented May 18, 2024

CAA2DCoordinate CAACoordinateTransformation::Equatorial2Horizontal(double LocalHourAngle, double Delta, double Latitude) noexcept
{
LocalHourAngle = HoursToRadians(LocalHourAngle);
Delta = DegreesToRadians(Delta);
Latitude = DegreesToRadians(Latitude);

CAA2DCoordinate Horizontal;
Horizontal.X = RadiansToDegrees(atan2(-cos(Delta)*sin(LocalHourAngle), sin(Delta)*cos(Latitude) - cos(Delta)*cos(LocalHourAngle)*sin(Latitude)));
if (Horizontal.X < 0)
Horizontal.X += 360;
Horizontal.Y = RadiansToDegrees(asin(sin(Latitude)*sin(Delta) + cos(Latitude)*cos(Delta)*cos(LocalHourAngle)));

return Horizontal;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant