mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-02-04 20:52:02 -05:00
Implemented the C function Astronomy_ObserverGravity. It implements the WGS 84 Ellipsoidal Gravity Formula, yielding the effective observed gravitational acceleration at a location on or above the Earth's surface. Wrote a demo program that also serves as a unit test. I verified a few of the calculations, so the file demo/c/test/gravity_correct.txt also serves as correct unit test output.
23 lines
554 B
Bash
Executable File
23 lines
554 B
Bash
Executable File
#!/bin/bash
|
|
Fail()
|
|
{
|
|
echo "FATAL($0): $1"
|
|
exit 1
|
|
}
|
|
|
|
if [[ "$1" == "debug" ]]; then
|
|
BUILDOPT='-g -O0'
|
|
elif [[ -z "$1" ]]; then
|
|
BUILDOPT='-O3'
|
|
else
|
|
Fail "unrecognized command line option"
|
|
fi
|
|
|
|
for name in gravity galactic camera moonphase positions linux_riseset riseset seasons culminate horizon lunar_eclipse triangulate; do
|
|
echo "Compiling ${name}.c"
|
|
gcc ${BUILDOPT} -Wall -Werror -o ${name} -I../../source/c ../../source/c/astronomy.c astro_demo_common.c ${name}.c -lm ||
|
|
Fail "Error building ${name}.c"
|
|
done
|
|
|
|
exit 0
|