New polar-alignment error calculations.
This improves the polar alignment error calculations, extending the work that Chris Rowland started in the polaralign.cpp file. It is integrated into the code in align.cpp that runs the polar-align scheme. A Unit Test is added.
The polar alignment calculations are now more exact--all aspects rely on spherical coordinates. The previous polar alignment scheme, while making those approximations, was probably pretty accurate anyway, as it restricted its operation to near the poles, where those approximates are pretty good.
The major improvement with this scheme is polar alignment can be done using any part of the sky, not just the pole area. If a user has no view of the pole, he/she can still align his/her mount, and, I expect, about as accurately as if the pole area was used.
The user interface is very similar to what was done before. A correction vector is calculated, and the user attempts to move a star he/she selects to the target position. However, since the user may be using a part of the sky away from the poles, and the apparent star motion when adjusting the mount's altitude and azimuth knobs varies and might not be orthogonal (there are parts of the sky where they may be close to parallel). Therefore, the correction vector display was augmented with an altitude correction line (in yellow) and an azimuth correction line (in green). The user is told to first move the target star along the altitude correction line by turning the altitude knob, and then along the azimuth line by turning the azimuth know. (This is not as critical near the pole, but is important in some other places). See this image of the new correction vector display.
Alignview's old offset and vector scheme is not used (i.e. the offset is always 0). The correction vector is recalculated for every point the user selects--this is an inexpensive calculation, and is a bit more accurate.
Since the user can now use parts of the sky away from the poles, and the user can select east or west slews, it's possible for the user to cause his/her telescope to hit the mount (or to perhaps cause a meridian flip) as part of this procedure. Of course, that's not good. I added a check at the start of the procedure, and the user has to explicitly OK crossing the meridian.
In my testing, polar alignment has worked well near the poles and away from them as well. I also tested with smaller slews (e.g. 20-degrees per slew instead of 30) and that seemed to work well.