Hi! I am working on a small application which will display two cities on a map given the cities’ longitude and latitude. As recommended by other people, I first chose the acceptable map projection (Miller Cylindrical) and then found its formula: (the Miller projection formula is at http://mathworld.wolfram.com/MillerCylindricalProjection.html) x = long – long0, y = 1.25 * ln[tan(0.25 * Pi + 2/5 * lat)], For calculations, I will use the PHP scripting language. X doesn’t have to be converted, so here’s the PHP code for Y: $y = 1.25 * log( tan( (0.25 * pi()) + (0.4 * $lat) ) ), // $lat is latitude However, when calculating y for lat=60.2 (or any number in degrees), I get an error in PHP scripting language (-1.#IND), which I guess has something to do with me supplying a bad formula or out-of-range data. Am I doing everything correctly here? I am not very strong in maths (forgot lots of it over the years), so I will appreciate any pointers on what to do in this situation. I think that I may be thinking in different units here (maybe I should use latitude in radians instead of degrees), but I am really confused. Thank you very much for all your help!!! Best regards, Stanislav That formula requires radian angle measure. The giveaway is the argument to tan, 0.25 * Pi + 2/5 * lat, which incorporates Pi/4 as an additive factor. This only happens if tan’s argument is expected to be in radians. To fix that, just multiply lat in degrees by Pi/180 in your formula. -Seth Source.