local DEG2RAD = math.pi / 180
local function makeXcoord( a, b, c, d, op )
return function( latitude, longitude )
local corr = op
and 360 * ( longitude < 0 and 1 or 0 )
or 0
return a + b *
math.cos( latitude * DEG2RAD ) *
math.sin( ( longitude + corr - c ) * DEG2RAD ) *
math.pow( 0.5 * (
1 +
math.sin( latitude * DEG2RAD ) *
math.sin( d * DEG2RAD )
+
math.cos( latitude * DEG2RAD ) *
math.cos( d * DEG2RAD ) *
math.cos( ( longitude + corr - c ) * DEG2RAD )
), -0.5 )
- ( -50 )
end
end
local function makeYcoord( a, b, c, d, op )
return function( latitude, longitude )
local corr = op
and 360 * ( longitude < 0 and 1 or 0 )
or 0
return 100 + a -
b * (
math.cos( c * DEG2RAD ) *
math.sin( latitude * DEG2RAD )
-
math.sin( c * DEG2RAD ) *
math.cos( latitude * DEG2RAD ) *
math.cos( ( longitude + corr - d ) * DEG2RAD )
) * math.pow( 0.5 * (
1 +
math.sin( latitude * DEG2RAD ) *
math.sin( c * DEG2RAD )
+
math.cos( latitude * DEG2RAD ) *
math.cos( c * DEG2RAD ) *
math.cos( ( longitude + corr - d ) * DEG2RAD )
), -0.5 )
end
end
local function makeXcoord_cil( a, b, op )
return function( latitude, longitude )
local corr = op
and 360 * ( longitude < 0 and 1 or 0 )
or 0
return 100 * ( longitude + corr - a ) / ( b - a )
end
end
local function makeYcoord_cil( a, b )
return function( latitude, longitude )
return 100 * ( a - latitude ) / ( a - b )
end
end
local function makeXcoord_circ( a, isNorthPole )
return function( latitude, longitude )
local op = isNorthPole
and -1
or 1
return 50 + a *
( 90 + op * latitude ) *
math.sin( longitude * DEG2RAD )
end
end
local function makeYcoord_circ( a, isNorthPole )
return function( latitude, longitude )
local op = isNorthPole
and -1
or 1
return 50 - a *
( 90 + op * latitude ) *
math.cos( longitude * DEG2RAD ) * op
end
end
return {
-- MORZA I OCEANY
[ 'Morze Śródziemne' ] = {
mapa = 'Mediterranean Sea location map.svg',
[ 'mapa-fizyczna' ] = 'Relief Map of Mediterranean Sea.png',
top = 48,
bottom = 29,
left = -7,
right = 42.5
},
[ 'Morze Bałtyckie' ] = {
mapa = 'Baltic Sea location map.svg',
[ 'mapa-fizyczna' ] = 'Relief Map of Baltic Sea.png',
top = 66.2,
bottom = 53.3,
left = 9,
right = 30.6
},
[ 'Morze Czarne' ] = {
mapa = 'Black Sea location map.svg',
[ 'mapa-fizyczna' ] = 'Black Sea relief location map.svg',
top = 48,
bottom = 39,
left = 24,
right = 44
},
[ 'Morze Karaibskie' ] = {
mapa = 'La2-demis-caribbean.png',
top = 28,
bottom = 7,
left = -93,
right = -58
},
[ 'Morze Kaspijskie' ] = {
mapa = 'Caspian_Sea_relief_location_map.jpg',
top = 48,
bottom = 35,
left = 46,
right = 55
},
[ 'Morze Południowochińskie' ] = {
mapa = 'South China Sea location map.svg',
[ 'mapa-fizyczna' ] = 'Relief Map of South China Sea.png',
top = 25.5,
bottom = 0,
left = 98.5,
right = 122.5
},
[ 'Morze Północne' ] = {
mapa = 'North Sea location map.svg',
[ 'mapa-fizyczna' ] = 'North Sea relief location map.jpg',
top = 62.5,
bottom = 50.5,
left = -5.2,
right = 13.2
},
[ 'Zatoka Perska' ] = {
mapa = 'Persian_Gulf_relief_location_map.png',
top = 31,
bottom = 23,
left = 47,
right = 58
},
[ 'Ocean Atlantycki' ] = {
mapa = 'Atlantic Ocean laea location map.svg',
[ 'mapa-fizyczna' ] = 'Atlantic Ocean laea relief location map.jpg',
[ 'mapa-sat' ] = 'Atlantic Ocean satellite image location map.jpg',
x = makeXcoord( 0, 50, -35, 0 ),
y = makeYcoord( -50, 40.7145, 0, -35 ),
[ 'x-sat' ] = makeXcoord_cil( -100, 45 ),
[ 'y-sat' ] = makeYcoord_cil( 90, -81 )
},
[ 'Ocean Indyjski' ] = {
mapa = 'Indian Ocean laea location map.svg',
[ 'mapa-fizyczna' ] = 'Indian Ocean laea relief location map.jpg',
[ 'mapa-sat' ] = 'Indian Ocean satellite image location map.jpg',
x = makeXcoord( 0, 52.4063, 90, -20 ),
y = makeYcoord( -53.1221, 55.4612, -20, 90 ),
[ 'x-sat' ] = makeXcoord_cil( 15, 150 ),
[ 'y-sat' ] = makeYcoord_cil( 35, -72 )
},
[ 'Ocean Spokojny' ] = {
mapa = 'Pacific Ocean laea location map.svg',
[ 'mapa-fizyczna' ] = 'Pacific Ocean laea relief location map.jpg',
[ 'mapa-sat' ] = 'Pacific Ocean satellite image location map.jpg',
x = makeXcoord( 0, 35.0444, -165, -10, true ),
y = makeYcoord( -49.0056, 38.3135, -10, -165, true ),
[ 'x-sat' ] = makeXcoord_cil( 92, 295, true ),
[ 'y-sat' ] = makeYcoord_cil( 72, -81 )
},
[ 'Arktyka' ] = {
mapa = 'Arctic Ocean location map 2.svg',
[ 'mapa-fizyczna' ] = 'Arctic Ocean relief location map 2.png',
[ 'mapa-azymutalna' ] = 'Arctic blank map.png',
[ 'mapa-sat' ] = 'Arctica surface.jpg',
x = makeXcoord_circ( 2.5, true ),
y = makeYcoord_circ( 2.5, true ),
[ 'x-azymutalna' ] = function( latitude, longitude )
return 50 - 1.25 * ( latitude - 90 ) *
math.sin( ( longitude - 27 ) * DEG2RAD )
end,
[ 'y-azymutalna' ] = function( latitude, longitude )
return 50 - 1.25 * ( latitude - 90 ) *
math.cos( ( longitude - 27 ) * DEG2RAD )
end,
[ 'x-sat' ] = function( latitude, longitude )
return 49.89670042 + 93.25008804 * 2 *
math.sin( ( 90 - latitude ) * DEG2RAD * 0.5 ) *
math.sin( longitude * DEG2RAD )
end,
[ 'y-sat' ] = function( latitude, longitude )
return 51.59141377 + 74.33749354 * 2 *
math.sin( ( 90 - latitude ) * DEG2RAD * 0.5 ) *
math.cos( longitude * DEG2RAD )
end
},
-- KONTYNENTY
[ 'Afryka' ] = {
mapa = 'Africa location map.svg',
[ 'mapa-fizyczna' ] = 'Africa relief location map.jpg',
[ 'mapa-sat' ] = 'Africa-locator.jpg',
x = makeXcoord( -1.147540983607, 71.1, 15, 0 ),
y = makeYcoord( -48,819444444445, 75.3, 0, 15 ),
[ 'x-sat' ] = makeXcoord_cil( -21.6, 54 ),
[ 'y-sat' ] = makeYcoord_cil( 43.2, -36 )
},
[ 'Ameryka Południowa' ] = {
mapa = 'South America laea location map.svg',
[ 'mapa-fizyczna' ] = 'South America laea relief location map.jpg',
x = makeXcoord( 0, 99.3492, -60, -17.5 ),
y = makeYcoord( -51.2026, 67.3182, -17.5, -60 )
},
[ 'Ameryka Północna' ] = {
mapa = 'North America laea location map.svg',
[ 'mapa-fizyczna' ] = 'North America laea relief location map with borders.jpg',
x = makeXcoord( 0, 69.398, -100, 47.5 ),
y = makeYcoord( -50, 68.9773, 47.5, -100 )
},
[ 'Azja' ] = {
mapa = 'Asia laea location map.svg',
[ 'mapa-fizyczna' ] = 'Asia laea relief location map.jpg',
[ 'mapa-walcowa' ] = 'Asia location map.svg',
x = makeXcoord( 0, 52.8948, 95, 50 ),
y = makeYcoord( -59.381, 59.381, 50, 95 ),
[ 'x-walcowa' ] = makeXcoord_cil( 18, 180 ),
[ 'y-walcowa' ] = makeYcoord_cil( 78.3, -13.5 )
},
[ 'Europa' ] = {
mapa = 'Europe laea location map.svg',
[ 'mapa-fizyczna' ] = 'Europe relief laea location map.jpg',
[ 'mapa-sat' ] = 'Europe_satellite_image_location_map.jpg',
[ 'mapa-walcowa' ] = 'Europe location map.svg',
x = makeXcoord( -13.612, 131.579, 10, 52 ),
y = makeYcoord( -44.89, 153.61, 52, 10 ),
[ 'x-sat' ] = makeXcoord_cil( -25, 60 ),
[ 'y-sat' ] = makeYcoord_cil( 72, 34 ),
[ 'x-walcowa' ] = makeXcoord_cil( -25, 54 ),
[ 'y-walcowa' ] = makeYcoord_cil( 82, 28 )
},
[ 'Oceania' ] = {
mapa = 'Oceania laea location map.svg',
[ 'mapa-fizyczna' ] = 'Oceania laea relief location map.jpg',
x = makeXcoord( 0, 50.8671, 170, -5, true ),
y = makeYcoord( -56.5869, 58.926, -5, 170, true )
},
[ 'Antarktyka' ] = {
mapa = 'Antarctica location map.svg',
[ 'mapa-fizyczna' ] = 'Antarctica relief location map.jpg',
[ 'mapa-koło' ] = 'Antarctic Ocean location map.svg',
[ 'mapa-koło-fizyczna' ] = 'Antarctic Ocean relief location map.png',
x = makeXcoord_circ( 1,666666667, false ),
y = makeYcoord_circ( 1,666666667, false ),
[ 'x-koło' ] = makeXcoord_circ( 1,25, false ),
[ 'y-koło' ] = makeYcoord_circ( 1,25, false ),
[ 'x-koło-fizyczna' ] = makeXcoord_circ( 1,25, false ),
[ 'y-koło-fizyczna' ] = makeYcoord_circ( 1,25, false )
},
-- INNE
[ 'świat' ] = {
mapa = 'World location map.svg',
[ 'mapa-sat' ] = 'Earthmap1000x500compac.jpg',
top = 90,
bottom = -90,
left = -180,
right = 180
}
}