The gcc-6 compiler in travis-ci has changed its behavior.
It is warning that 'fmid' local variable in Search() may
be used uninitialized. I believe it is safe but I'm adding
an initialization to fmid to make the warning go away.
I need a way to undo a refraction correction:
given a post-refraction altitude, find the unrefracted
altitude that leads to it. Starting to write the code.
Not finished yet.
These are the final 4 rotation functions to complete every
possible coordinate transform.
Finished unit tests of verifying that all triangular
cycles of transitive rotation are consistent.
Astronomy_CombineRotation was multiplying matrices correctly,
but it was doing it in the backwards order from what I need.
I forgot that to rotate a vector V by a matrix M, you multiply M*V,
with the matrix on the left.
Likewise, to rotate a matrix A by another matrix B, you need B*A, not A*B.
This explains why I was seeing larger than expected errors combining
nutation and precession: nutation is a very tiny shift in orientation,
so the errors were small but noticeable. Tightened the error thresholds
in the unit test code.
Astronomy_Rotation_HOR_EQJ converts from horizontal of-date coordinates
to equatorial J2000 coordinates. Here I could no longer ignore the
errors caused by having backwards matrix multiplication, leading
to discovering the problem in Astronomy_CombineRotation.
Astronomy_HorizonFromVector is a specialized variant of
Astronomy_SphereFromVector that flips the orientation of the
azimuth angle to the more traditional clockwise-from-north
direction used in navigation and cartography.
It also allows the same optional refraction correction as
Astronomy_Horizon.
Astronomy_Rotation_EQD_HOR converts a equatorial-of-date vector
to a horizontal vector. The horizontal vector has the following
components:
x = North
y = West
z = Zenith
Removed trailing whitespace in generate.c.
This function returns the constant rotation matrix that converts
equatorial J2000 coordinates to ecliptic J2000 coordinates.
Verified that it is exactly consistent with existing Ecliptic().
Astronomy_RotateVector translates a vector in one orientation
to another orientation, as specified by a rotation matrix.
I will use this to implement all the coordinate transforms
among EQJ, EQD, ECL, HOR.
Added new data type astro_spherical_t that represents generic spherical coordinates.
Implemented Astronomy_VectorFromSphere to convert spherical coordinates
to Cartesian coordinates. Included unit test to verify it is working as expected.
Beginning to implement functions for converting among the
following four orientation systems:
- EQJ: equatorial J2000
- EQD: equatorial of date
- ECL: ecliptic J2000
- HOR: horizontal
Starting with some basic functions for manipulating rotation matrices.
Astronomy_CombineRotation multiplies two rotation matrices to obtain
a third that combines their effects in order. I will use these for
combining a precession matrix and a nutation matrix, to obtain a
rotation matrix that can convert between EQJ and EQD.
Astronomy_InverseRotation will allow converting in either direction
between two orientations.
Still need to implement moon calculations and associated code.
Reworked AstroVector as a struct instead of a class, to reduce
memory allocation overhead.
This is just to get build errors to go away.
Will have to come back and flesh out all of the documentation
once I start working on the C# documentation generator.
I'm checking in a broken build on purpose in this topic branch
so that I can move the work over to my Windows machine and use
Visual Studio to help with formatting XML comments.
Decided to move call to makedoc script from run script.
It was confusing that it was hidden inside unit_test_js,
especially because it invokes the code generator for
all supported languages.