ForSundial is a long term hobby project, I won’t say a dream, but something that comes back regularly in my life: building a sundial. There is no special reason to use Fortran rather than any other language, as the computation is really not intensive! Just a few trigonometric formulas are needed, and a few loops. But there is no reason to use another language if you like Fortran.
For SVG drawing, I could probably have used some SVG library written in Fortran but I have used instead the Cairo library, via the fpm dependency cairo-fortran. Firstly because I am used to it since 2011, secondly because it handles fonts, which is useful for writing numbers and text on the sundial.
Many types of sundial exist. This project draws an horizontal sundial for you latitude. In fact, for the moment, it is designed for the Northern Hemisphere, especially between the tropic of Cancer and the North polar circle. Adapting it for the Southern Hemisphere should probably be rather simple (just inverting the cardinal points and the positions of the hours?) Let me know your thoughts (a link to a photo of a sundial in the Southern Hemisphere would be instructive).
On the left a prototype built in 2023 using our Trotec Speedy 400 laser cutting machine, and on the right a SVG file generated with the latest version of the project:
During the day, the shadow of the style (short in Summer, long in Winter) is traveling along an hyperbola, which is reduced to a line at the equinoxes. The extreme hyperbolas are for the Summer and Winter solstices. Sundials are an interesting way to do astronomy, like before Galileo Galilei. No telescope needed and no light pollution problem!
Hosted on Codeberg.org
Following that thread about GitHub, I wanted to experiment another forge. The promising Codeberg.org is 100% free (the Forgejo software + the forge itself), as in freedom and free beer (although hosting for free implies of course donations for running the infrastructure, as Codeberg e.V. is a nonprofit organization). It is based in Berlin (Germany): Codeberg could be translated in English by “Codemountain”.
You can test ForSundial like with any other forge based on git:
$ git clone https://codeberg.org/vmagnin/forsundial.git
and if it were a library (which it is not), you could of course add it in the [dependencies]
section of your fpm project, even if it is hosted elsewhere.
Of course, if you want to participate to the project (issues, pull requests, etc.) you will need to create an account on the forge. Maybe in the future we will have free forges with some kind of interoperability, like in the Fediverse: a pull request is a pull request and an issue is an issue. All the functionalities I need are available on Codeberg and the interface is so similar to that of GitHub or GitLab that it is very easy to take in hand. Well, that is an interesting experience: I am on GitHub since 2011, and I now know the only reason why I am still there: for the Fortran community.