use double precision fp math for mercartor projection and point-line projections (for now), fixes #1191

This commit is contained in:
Dennis Luxen
2014-10-09 18:58:58 +02:00
parent 2b9e25300f
commit 440244eed8
2 changed files with 17 additions and 17 deletions
+4 -4
View File
@@ -30,14 +30,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cmath>
inline float y2lat(const float a)
inline double y2lat(const double a)
{
return 180.f * static_cast<float>(M_1_PI) * (2.f * std::atan(std::exp(a * static_cast<float>(M_PI) / 180.f)) - static_cast<float>(M_PI_2));
return 180. * M_1_PI * (2. * std::atan(std::exp(a * M_PI / 180.)) - M_PI_2);
}
inline float lat2y(const float a)
inline double lat2y(const double a)
{
return 180.f * static_cast<float>(M_1_PI) * std::log(std::tan(static_cast<float>(M_PI_4) + a * (static_cast<float>(M_PI) / 180.f) / 2.f));
return 180. * M_1_PI * std::log(std::tan(M_PI_4 + a * (M_PI / 180.) / 2.));
}
#endif // MERCATOR_UTIL_H