clear; close; clc % Latitude coordinates Y_tbl = [52.52437 39.9075 55.75222 34.05223 -33.86785 51.50853 -22.90278 -26.2022700]'; % Longitude coordinates X_tbl = [13.41053 116.39723 37.61556 -118.24368 151.20732 -0.12574 -43.2075 28.0436300]'; CoordTable = table(Y_tbl, X_tbl); Y_Ber = CoordTable.Y_tbl(1); X_Ber = CoordTable.X_tbl(1); CitiesDestination = { 'Peking','Moskau','Los Angeles','Sydney',... 'London','Rio de Janeiro','Johannesburg'}; CityPairs = { 'Berlin nach Peking','Berlin nach Moskau','Berlin nach Los Angeles','Berlin nach Sydney',... 'Berlin nach London','Berlin nach Rio de Janeiro','Berlin nach Johannesburg'}; landareas = shaperead('landareas.shp','UseGeoCoords',true); for k = 2:length(CoordTable.Y_tbl)-1 figure(k); title(sprintf('%s', CityPairs{k-1})); set(gcf, 'Position', [400, 100, 600, 600]) axesm ('mercator', 'Frame', 'on', 'Grid', 'on'); latlim = [-86 86]; lonlim = [-180 180]; geoshow(landareas); % circle track [lattrkgc,lontrkgc] = track2(Y_Ber,X_Ber,CoordTable.Y_tbl(k),CoordTable.X_tbl(k)); % rhumb line track = direct line [lattrkrh,lontrkrh] = track2('rh',Y_Ber,X_Ber,CoordTable.Y_tbl(k),CoordTable.X_tbl(k)); plotm(Y_Ber,X_Ber, 'xg', 'MarkerSize', 10, 'LineWidth', 2); hold on; plotm(CoordTable.Y_tbl(k),CoordTable.X_tbl(k), 'xr', 'MarkerSize', 10, 'LineWidth', 2); % Plot both tracks plotm(lattrkgc,lontrkgc,'Color','#0072BD') % Navy blue, circle track plotm(lattrkrh,lontrkrh,'Color','#A2142F') % Darker red, direct line textm(Y_Ber,X_Ber, 'Berlin'); textm(CoordTable.Y_tbl(k),CoordTable.X_tbl(k), CitiesDestination{k-1}); end