I am stuck on a little problem of creating a simple map app. what i am trying to learn is the mathematics behind the conversion of my WGS 84 GPS co-ordinates.
this is the problem:
I have two WGS 84 co-ordinates; lat:53.7506 Long:-2.3931 + lat:53.7638 Long:-2.4212 I want to convert these values onto points on my screen x = 'a' value between 0 and 200 and y = 'a' value between 0 and 200
i have said a value as this value will be derived from the lat and long figures as mentioned above.
can anyone help please?
i have tried normalising the figures using the formula N = V/D (N being the normailsed value with V being the co-ordinate value and D being the max value of the screen area which in my case is 200. this didnt work as all the figures generated was all in the 199 - 200 range but I have gotten lost with the thought process on this now so I need some help.
I a开发者_高级运维m sure there is a formula for calculating the right but i cannot seem to find it
please help as I need to sleep well tonight :)
thanks
It is a simple linear mapping for x, and one for y with a twist:
x) as the lower limit is the left hand side, you can simply use
x = (long + 180)/360 * x_max
y) as long 0 is in the middle, you'll need to substract/add accordingly:
y = (y_max/2) - (lat/90) * (y_max/2)
精彩评论