private function toDms(float $decimal, string $axis = self::LATITUDE): string
    {
        $d = (int) floor(abs($decimal));
        $m = (int) floor((abs($decimal) - $d) * 60);
        $s = ((abs($decimal) - $d) * 60 - $m) * 60;
        if (self::LATITUDE === $axis) {
            $h = ($decimal < 0) ? 'S' : 'N';
        } else {
            $h = ($decimal < 0) ? 'W' : 'E';
        }

        return sprintf('%d %d %.3f %s', $d, $m, $s, $h);
    }
private function toDms(float $decimal, string $axis = self::LATITUDE): string
    {
        $d = (int) floor(abs($decimal));
        $m = (int) floor((abs($decimal) - $d) * 60);
        $s = ((abs($decimal) - $d) * 60 - $m) * 60;
        if (self::LATITUDE === $axis) {
            $h = ($decimal < 0) ? 'S' : 'N';
        } else {
            $h = ($decimal < 0) ? 'W' : 'E';
        }

        return sprintf('%d %d %.3f %s', $d, $m, $s, $h);
    }
private function toDms ( float $ decimal , string $ axis = self :: LATITUDE ) : string { $ d = ( int ) floor ( abs ( $ decimal ) ) ; $ m = ( int ) floor ( ( abs ( $ decimal ) - $ d ) * 60 ) ; $ s = ( ( abs ( $ decimal ) - $ d ) * 60 - $ m ) * 60 ; if ( self :: LATITUDE === $ axis ) { $ h = ( $ decimal < 0 ) ? 'S' : 'N' ; } else { $ h = ( $ decimal < 0 ) ? 'W' : 'E' ; } return sprintf ( '%d %d %.3f %s' , $ d , $ m , $ s , $ h ) ; }
Determine the degree minute seconds value from decimal.

@param float  $decimal
@param string $axis

@return string
Determine the degree minute seconds value from decimal .