/*  
 *  latToMercator.hpp
 *
 *  Created by Thant on 4/30/2012
 *  Copyright 2012 Telenav. All rights reserved.
 *
 *  This takes a value between -85.051128 and 85.051128 degrees and
 *  maps it from zero to one using a Mercator projection.
 *
 *      double mercator = log(tan(degToRad(latitude) / 2.0 + M_PI / 4.0));
 *      double normalized = (mercator / (M_PI * 2.0) + 0.5);
 *
 *  For efficiency on primitive hardware, it uses a table-lookup and
 *  interpolation.
 *
 *  The table (and indeed the entire latToMercator.cpp file) is
 *  generated by TnTools/utils/latToMercator
 *
 */

#ifndef Foundation_Math_latToMercator_INCLUDED
#define Foundation_Math_latToMercator_INCLUDED

namespace Tn {

namespace math {

bool generateMercatorTable(unsigned kb);
    
double latToMercator(double latitude);

} // namespace math

} // namespace tn


#endif
