Sun amd Moon data for GPS Programs

Stellaferox

Active Member
Licensed User
Hi,

Thnx for the application. I use the mathematical algoritm on AstronomieAntwoorden: Zonnepositie
in Excel. It is very precise. If there is sufficient demand I will implement it in B4PPC.
For those non-dutchies out there, unfortunately in Dutch, but with a little effort workable.
Marc
 

Stellaferox

Active Member
Licensed User
Hi all,

I am posting a very simple calendar application which was posted a while ago. It just displays a datepicker and underneath the code is the translated page of the Dutch site mentioned in the post above as commented text.
Also copied is the text of the earlier mentioned algorithm.
The translations are not always the most logical because of the automatic Windows Explorer translator.
Have fun!
Marc
 

Stellaferox

Active Member
Licensed User
Hi all,

For those interested: Astronomy Answers: Position of the Sun also has an english translation. Just scroll down the page and bottomleft is a choice for languages. The postions computed with these formulas are very accurate.
Marc

PS: I attached a little program that computes the time of sunrise, noon and sunset for a given position (definition in Globals).
 

Attachments

  • Calendar2.sbp
    7.3 KB · Views: 409
Last edited:

pilot324

New Member
Sun and Moon data for GPS Programs

The attached is a module to be attached to GPS programs.
Given the coordinates and date from the GPS it calculates the Sunrise and Sunset times, the moonrise and Moonset times and the moon phase for that date with a photo of the moon.

The algorithms are translations of what I found in the net, except for the algo of the moon phase for which I used part of the algorithm of date translation from Gregorian Calendar to Hebrew calendar, and this is the most accurate algorithm.

(If you are interested in the Hebrew calendar - ask me for the full algo).

The main module in the attachment is just a tool to run the module, instructions for the integration appear in the header of the module.
There are provisions for use with either GPS.dll or GPSDriver.dll



The photos should be put with their "moons" directory next to the application.

Happy navigation ! :)

Updated to ver 2, to make the module independent of the type of GPS library.

After Alfcen remark, I updated it to ver 3 to be able to work independently of any other gps related code, with gpsdriver.

Edit: see in #16 updated and corrected astro.bas module, after bugs found by Agraham and Jony. Thanks.
I tried your software. I think it is inspired by a Sky & Telescope pub 1989. Anyway, I got stucked
Sun and Moon data for GPS Programs

The attached is a module to be attached to GPS programs.
Given the coordinates and date from the GPS it calculates the Sunrise and Sunset times, the moonrise and Moonset times and the moon phase for that date with a photo of the moon.

The algorithms are translations of what I found in the net, except for the algo of the moon phase for which I used part of the algorithm of date translation from Gregorian Calendar to Hebrew calendar, and this is the most accurate algorithm.

(If you are interested in the Hebrew calendar - ask me for the full algo).

The main module in the attachment is just a tool to run the module, instructions for the integration appear in the header of the module.
There are provisions for use with either GPS.dll or GPSDriver.dll



The photos should be put with their "moons" directory next to the application.

Happy navigation ! :)

Updated to ver 2, to make the module independent of the type of GPS library.

After Alfcen remark, I updated it to ver 3 to be able to work independently of any other gps related code, with gpsdriver.

Edit: see in #16 updated and corrected astro.bas module, after bugs found by Agraham and Jony. Thanks.
Hello,
I tried your Astro3.zip
I believe it is inspired by a SkY & Telescope publication in 1989.

Anyway, I get stuck always on the same line, in the" Position loop sub"
The value of Ma(2,3), in the line
Z1 = R1 * (90.567 - 41.685 / Ma(2, 3))
is always nil, equals to zero.

I would really appreciate if someone could have a look at this.

Thank you

For i = 1 To 3
x495
Ma(i, 1) = A5
Ma(i, 2) = D5
Ma(i, 3) = R5
T = T + 0.5
Next
If Ma(2, 1) <= Ma(1, 1) Then
Ma(2, 1) = Ma(2, 1) + P2
End If
If Ma(3, 1) <= Ma(2, 1) Then
Ma(3, 1) = Ma(3, 1) + P2
End If
Z1 = R1 * (90.567 - 41.685 / Ma(2, 3))
 
Top