<?php
function sign($x) {
  if ($x > 0) {
      return 1;
  } else if ($x < 0) {
      return -1;
  }
  else if ($x == "-0") {
      return -1;     
  }
  return 1;
}
function degversdec($p) {
  $a = array();
  $a[] = $p[x][degres] + sign($p[x][degres])* $p[x][minutes]/60 + sign($p[x][degres])* $p[x][secondes]/3600;
  $a[] = $p[y][degres] + sign($p[y][degres])* $p[y][minutes]/60 + sign($p[y][degres])* $p[y][secondes]/3600;
  return $a;
}
function decversdeg($xf) {
 $xs = (($xf>0)?floor($xf):ceil($xf)) . "° "; 
 $xf -= (($xf>0)?floor($xf):ceil($xf)); 
 $xf = abs($xf)*3600;
 return $xs . floor($xf / 60) . "' ". ($xf % 60) . "&quot; " ;
}
function pas_vide($v) {
   return (! empty($v));
}

?>