I am trying to calculate map of Europe in Lambert projection. I am using formula from Wikipedia (Lambert wiki), but calculation is very slow in comparison with Mercator. I know, there are
pow to calculate (Mercator has only one
ln), but the difference is almost 30 minutes (Mercator is done in about 3 minutes).
Is there some kind of speed up, or similar projection, that can be used ? I also need to put result into image with width and hight. For Mercator, I am using this: https://stackoverflow.com/questions/5983099/converting-longitude-latitude-to-x-y-coordinate. Can it be altered to Lambert (or Lambert similar) projection ? Because if I use same approach only witch changed formulas for projection, Lambert is moved to upper part of image and I can see only part of Europe)
EDIT: Added code
double longitude = lon * (MPI / 180.0); double latitude = lat * (MPI / 180.0); double lambertPhi = this->lambertF * pow(cot(0.25 * MPI + 0.5 * latitude), this->lambertN); lonOut = lambertPhi * sinf(this->lambertN * longitude); latOut = this->lambertPhi0 - lambertPhi * cosf(this->lambertN * longitude);
All this-> variables are precomputed only once