Temat: różnice miedzy WGS 1984 i PUWG 1992
Korzystając z
http://www.syryjczyk.krakow.pl/Mapy_Pol_GPS_1_4.zip
Napisałem funkcję w php.
function puwgToWgs($x, $y){
$c2 = 0.003356551485597; //w21
$c4 = 0.000006571873148459; //w22
$c6 = 0.00000001764656426454; //w23
$c8 = 0.00000000005400482188; //w24
$b2 = -0.00083773216816410000; //w30
$b4 = -0.00000005905869626083; //w31
$b6 = -0.00000000016734889050; //w32
$b8 = -0.00000000000021677378; //w33
$mo = 0.9993; //j9
$ro = 6367449.14577; //j18
$Xgk = ($x + 5300000) / $mo; //w36
$Ygk = ($y - 500000) / $mo; //w37
$u = $Xgk / $ro; //w34
$v = $Ygk / $ro; //w35
$alpha = $u + ($b2 * sin(2 * $u) * cosh(2 * $v) + $b4 * sin(4 * $u) * cosh(4 * $v) + $b6 * sin(6 * $u) * cosh(6 * $v) + $b8 * sin(8 * $u) * cosh(8 * $v)); //w28
$betta = $v + ($b2 * cos(2 * $u) * sinh(2 * $v) + $b4 * cos(4 * $u) * sinh(4 * $v) + $b6 * cos(6 * $u) * sinh(6 * $v) + ($b8 * cos(8 * $u) * sinh(8 * $v))); //w29
$w = 2 * atan(exp($betta)) - pi() / 2; //w27 $deltaLambda = atan((tan($w)) / cos($alpha)) ; //w26
$fi = asin(cos($w) * sin($alpha)) ; //w25
$radiany = $fi + $c2 * sin(2 * $fi) + $c4 * sin(4 * $fi) + $c6 * sin(6 * $fi) + $c8 * sin(8 * $fi) ; //w14
$lat = rad2deg($radiany);
$lon = 19 + rad2deg($deltaLambda);
return array($lat, $lon);
}