国产精品成人VA在线观看,亚洲日韩在线中文字幕综合,亚洲AV电影天堂男人的天堂,久久人人爽人人爽人人av东京热

News新聞

業(yè)界新聞動(dòng)態(tài)、技術(shù)前沿
Who are we?

您的位置:首頁(yè)      樂(lè)道系統(tǒng)FAQ      PHP實(shí)現(xiàn)騰訊與百度坐標(biāo)轉(zhuǎn)換

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

標(biāo)簽: 發(fā)布日期:2017-08-05 00:00:00 244

廢話不多說(shuō),直接上代碼

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];

}