jquery.earth-3d icon indicating copy to clipboard operation
jquery.earth-3d copied to clipboard

Coordinates in Longitude , Latitude

Open javagc opened this issue 10 years ago • 5 comments

I have longitude and latitude , How can I get alfa and delta?

javagc avatar Feb 17 '15 18:02 javagc

I've cracked Longitude but am having some problem with latitude. This may be because of the way the image is projected onto the sphere. You can see how little of anywhere above 60degrees or below -60degrees is represented. For this reason I think we may have to adjust the latitude or perhaps the distortion on the maps we project onto the sphere.

                     //Coordinates for Cornwall, UK
              var latitude = 50.089882;
              var longitude = -5.619530;

              var locations = {
                obj1: {
                  alpha: ((90 - latitude) / 180) * Math.PI,
                  delta: ((90 - (longitude + 180))/180) * Math.PI,
                  name: 'Cornwall, UK'
                },
              };

Also this doesn't work on tilted globes it only seems accurate on the simple globes (where Latitude is incorrect).

alistairheath avatar Sep 01 '15 11:09 alistairheath

Update: The above is correct if you use a Mercator projection of the globe as opposed to the provided image (which is an equirectangular projection).

alistairheath avatar Sep 01 '15 14:09 alistairheath

Thank you for this information, I will take a look at it. I tried several times to resolve this issue in a elegant manner (using mathematics), but I am afraid my level is not good enough. Maybe I will post it on a mathematics forum someday.

sdrdis avatar Sep 06 '15 15:09 sdrdis

does anyone have an answer to this?

blursolo avatar Sep 13 '16 10:09 blursolo

I have some ideas about the solution, but I won't have the time to implement them this month, sorry !

If you know math, you can look into the comments of:

https://github.com/sdrdis/jquery.earth-3d/blob/master/sphere-hacked.js

And try to calculate the invert transformation.

sdrdis avatar Sep 13 '16 22:09 sdrdis