Format/typo check 2013/morgan1

I also included the dates for the two unnamed undated comets that the
author referred to so that one can see what is meant: Comet Halley and
Comet Hale-Bopp, labelled Ha and Hb in the program which is now noted in
the README.md file too.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-03 07:55:18 -08:00
1 parent f9a3d86c7b
commit 1f92e5153f
1 file changed
+31 -13
+31 -13
View File
@@ -18,6 +18,10 @@ echo "2013/10/03" | ./morgan1
echo "1985/10/28" | ./morgan1 echo "1985/10/28" | ./morgan1
echo "1996/12/31" | ./morgan1 echo "1996/12/31" | ./morgan1
echo "1986/03/31" | ./morgan1 # Comet Halley (look for 'Ha')
echo "1997/04/01" | ./morgan1 # Comet Hale-Bopp (look for 'Hb')
``` ```
Try pressing the arrow keys when your focus is in the window. Try pressing the arrow keys when your focus is in the window.
@@ -50,35 +54,49 @@ calendar](https://en.wikipedia.org/wiki/Julian_calendar) and
[Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar) (10 days [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar) (10 days
missing between 1582/10/04 and 1582/10/15). missing between 1582/10/04 and 1582/10/15).
The scale is logarithmic to be able to display the 8 planets without having The scale is logarithmic to be able to display the [8
Mercury, Venus, Earth and Mars squeezed around the Sun. planets](http://news.bbc.co.uk/2/hi/5282440.stm) without having
[Mercury](https://science.nasa.gov/mercury),
[Venus](https://science.nasa.gov/venus/),
[Earth](https://science.nasa.gov/earth/facts) and
[Mars](https://science.nasa.gov/mars) squeezed around the
[Sun](https://science.nasa.gov/sun/).
The size is not proportional either. The size is not proportional either.
### Bonus ### Bonus
It also displays the position of 2 famous comets during their last approach: It also displays the position of 2 famous comets during their last approach:
- The first one around the third IOCCC. - The [first one](https://science.nasa.gov/solar-system/comets/1p-halley/)
- The second one between the thirteenth and fourteenth IOCCC. around the [third IOCCC](/years.html#1986).
- The [second
one](https://science.nasa.gov/solar-system/comets/c-1995-o1-hale-bopp/) between
the [thirteenth](/years.html#1996) and [fourteenth](/years.html#1998) IOCCC.
### Limitations ### Limitations
* ASCII character set is assumed. * ASCII character set is assumed.
* A C99 compiler is required (for some `math.h` functions). * A C99 compiler is required (for some `math.h` functions).
* The position should be correct for years between (-1000; +3000) * The position should be correct for years between (-1000; +3000)
* The approximations done in the formula are OK for displaying the * The approximations done in the formula are OK for displaying the position
position around the sun but not for other applications like ephemeride or around the [Sun](https://science.nasa.gov/sun/) but not for other applications
sky view from Earth (angles may be off by 1 or 2 degrees sometimes). like [ephemeride](https://en.wikipedia.org/wiki/Ephemeris) or sky view from
[Earth](https://science.nasa.gov/earth/facts) (angles may be off by 1 or 2
degrees sometimes).
### Obfuscation ### Obfuscation
* Reuse of 1 letter variables. * Reuse of 1 letter variables.
* Only the main function with some `for` loops. * Only the `main()` function with some `for` loops.
* Constants for orbital elements encoded in a string. * Constants for orbital elements encoded in a string.
* Hexadecimal and decimal values used inconsistently. * Hexadecimal and decimal values used inconsistently.
* Comparisons order are not consistent. * Comparisons order are not consistent.
* A lot of stuff is done in the different parts of the for loop. * A lot of stuff is done in the different parts of the `for` loop.
### Compilation warnings ### Compilation warnings
@@ -104,10 +122,10 @@ morgan1.c:56:14: warning: '&&' within '||' [-Wlogical-op-parentheses]
This is due to most of the parentheses and braces being removed when This is due to most of the parentheses and braces being removed when
unnecessary. unnecessary.
To verify the display, you can look at one of this programs : To verify the display, you can look at one of these programs :
* xephem : https://web.archive.org/web/20130310133219/http://www.clearskyinstitute.com/xephem/ * xephem : <https://web.archive.org/web/20130310133219/http://www.clearskyinstitute.com/xephem/>
* homeplanet : https://www.fourmilab.ch/homeplanet/ * homeplanet : <https://www.fourmilab.ch/homeplanet/>
* https://www.theplanetstoday.com * <https://www.theplanetstoday.com>
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License: