sdrdis / jquery.earth-3d

JQuery plugin that allows you to draw a beautiful 3d spinning earth on canvas. Take a look at the demo:

Home Page:http://sdrdis.github.com/jquery.earth-3d/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coordinates in Longitude , Latitude

javagc opened this issue · comments

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

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).

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).

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.

commented

does anyone have an answer to this?

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.