Skip to content

Prevent overshooting cosine in CachingDms

Toni Schriber requested to merge escriban/kstars:haversine into master

Sometimes the target field of CCD-module was not updated, because the distance to the nearest star was NAN. The reason was the possible, random overshooting of the cosine in the CachingDms-variables in SkyPoint::angularDistanceTo(), which leads to a faulty, negative haversine. A simple std::fmin() prevents any cosine larger than 1.

Edited by Toni Schriber

Merge request reports

Loading