I have a vector full of Lat Long coordinates in this format
82.0000000, -180.0000000
I am trying to convert them into an X and a Y coordinate to plot them to a map using this code, which as far as i can see is right...
X:
double testClass::getX(double lon)
{
// Convert long to X coordinate (2043 = map width)
double x = lon;
// Scale
x = x * 2043.0 / 360.0;
// Center
x += 2043.0/2.0;
return x;
}
Y:
double testClass::getY(double lat)
{
// Convert lat to Y coordinate (1730 = map height)
double y = -1 * lat;
// Scale
y = y * 1730.0 / 180.0;
// Center
y += 1730.0/2.0;
return y;
}
However when plotted on my map i can see the points do resemble a world map but they are all off by x amount and i think its something to do with my scaling
any ideas?