欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP實(shí)現(xiàn)騰訊與百度坐標(biāo)轉(zhuǎn)換

 更新時(shí)間:2017年08月05日 09:04:40   投稿:jingxian  
下面小編就為大家?guī)硪黄狿HP實(shí)現(xiàn)騰訊與百度坐標(biāo)轉(zhuǎn)換。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

廢話不多說,直接上代碼

public function coordinate_switch($a,$b){//百度轉(zhuǎn)騰訊坐標(biāo)轉(zhuǎn)換


  $x = (double)$b - 0.0065;
  $y = (double)$a - 0.006;
  $x_pi = 3.14159265358979324;
  $z = sqrt($x * $x+$y * $y) - 0.00002 * sin($y * $x_pi);

  $theta = atan2($y,$x) - 0.000003 * cos($x*$x_pi);

  $gb = number_format($z * cos($theta),15);
  $ga = number_format($z * sin($theta),15);


  return ['Latitude'=>$ga,'Longitude'=>$gb];

}

public function coordinate_switchf($a,$b){//騰訊轉(zhuǎn)百度坐標(biāo)轉(zhuǎn)換


  $x = (double)$b ;
  $y = (double)$a;
  $x_pi = 3.14159265358979324;
  $z = sqrt($x * $x+$y * $y) + 0.00002 * sin($y * $x_pi);

  $theta = atan2($y,$x) + 0.000003 * cos($x*$x_pi);

  $gb = number_format($z * cos($theta) + 0.0065,6);
  $ga = number_format($z * sin($theta) + 0.006,6);


  return ['Latitude'=>$ga,'Longitude'=>$gb];

}

以上這篇PHP實(shí)現(xiàn)騰訊與百度坐標(biāo)轉(zhuǎn)換就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論