Files
astronomy/demo/c/build
Don Cross 37084a156d C Earth gravity calculation.
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.
2021-07-19 14:23:27 -04:00

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