draw flighroute on mercator map how to calculate polyline points with a given longitude -


I would like to draw a polyline between two cities on a Mercator map eg Start point:

  Location Berlin = new location (52.517, 13.40); Place tokio = new location (35.70,139.767);   

This should look like a flight route.

So I wanted to go through all the longitude values ​​between two cities and calculate the respective latitude values:

  location location selection = new location compilation (); Location next = new location (Berlin.latitude, Berlin.languitud); // Startup (double X = Berlin.logram + 1; X & lt; Tokyo; lengthening; x ++) {locationCollection.Add (next); Next = new location (???, x); }   

The question is how can I calculate latitude for each latitude value for polyline? Thanks!

to:

This implementation is in C.

  #define PI 3.14159265358979323846 Double degree_didien (double D) {return D * PI / 180.0; } Dual Radius_Agre (double R) {Return R * 180.0 / PI; } Double latitude (double latte 1, double lawn 1, double latte 2, double lawn 2, double lawn) {return ethan (sin (lat1) * cos (lat2) * sin (lon-lon2) -sin (lat2) * Cos (lat1) * sin (longitude-lon1)) / (cos (lat1) * cos (lat2) * sin (lon1-lon2)); } Int main () {// Start the degree and start the end lat1_d = 52.517; Double loan 1_d = 13.40; Double latitude 2_d = 35.70; Double loan 2_d = 13 9 767; // Double in the radians initially and lat1_r = degrees_radians (lat1_d); Double lon1_r = degree_deadian (lon1_d); Double lat2_r = degree_organic (lat2_d); Double loan 2_r = degree_anadi (lon2_d); // Repeat the latitude between 1 and 2 between the repetition of each degree (afternoon loan = seat (lon1_d); lon & lt; lon2_d; lon + = 1.0) {double lat_r = latitude (lat1_r, lon1_r, lat2_r, lon2_r) , Degrees_radians (loans))); Double lat_d = radian_agrace (lat_r); Printf ("% 3.f,% .3f \ n", let_d, loan); } Return 0; }   

The maximum latitude reaching the largest circle between Berlin and Tokyo is shown at 68 degrees Celsius at 68 degrees Celsius.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -