How to Implement Longitude and Latitude in Unity3d
Before asking this question i search a lot but all is vein i try to describe my problem: i want to plot a longitude and latitude which is in decimal form on xy in unity3d. my longitude and latitude are
Latitude:-
Bottom Left: 31.510881
Bottom Right: 31.510869
Upper Left:31.511056
Upper Right:31.511053
Longitude:-
Bottom Left: 74.371806
Bottom Right: 74.372064
Upper Left:31.74.371803
Upper Right:74.372061
And my Camera is like :-
Bottom Left: 0.0 x , 0.0 y
Bottom Right: 5.6 x, 0.0 y
Upper Left: 0.0 x, 10.6 y
Upper Right:5.6 x, 10.6 y
My Screen Resulution is 720 X x 1280 Y.
I Want to get longitude and latitude and then convert something in which is fit between my camera space so it is visible to user or screen.
I already Tried :
x = R cos(lat) cos(lon)
y = R cos(lat) sin(lon)
z = R *sin(lat)
R is radius which is 6371km
And
So My Screen Resulution 720 X 1280 so by divide it by 2 we got 360 and 640 so
X=360 + ((Longitude*360)/180)--> X=360+ ((Longitude*360)/180)--> X=..........
Y=640- ((Latitude*640)/180)--> Y=640- ((Latitude*640)/180)--> Y=............
Which is also not correct
Here is my List of Longitude and Latitude which is Between Longitude and Latitude which i mention above
https://www.dropbox.com/s/oqhe4rvsdh1o6pi/Map_Calculations.xlsx?dl=0