src/Malenki/Math/Unit/Angle.php
public function dms()
    {
        $float = abs($this->deg());

        $prov = function ($float) {
            $whole_part = (integer) $float;
            $fractional_part = $float - $whole_part;

            $out = new \stdClass();
            $out->whole = $whole_part;
            $out->fractional = $fractional_part * 60;

            return $out;
        };

        $prov_1 = $prov($float);
        $prov_2 = $prov($prov_1->fractional);
        $prov_3 = $prov($prov_2->fractional);

        $dms = new \stdClass();
        $dms->d = $prov_1->whole;
        $dms->m = $prov_2->whole;
        $dms->s = $prov_3->whole;
        $dms->str = sprintf('%d°%d′%d″', $dms->d, $dms->m, $dms->s);

        return $dms;
    }
public function dms()
    {
        $float = abs($this->deg());

        $prov = function ($float) {
            $whole_part = (integer) $float;
            $fractional_part = $float - $whole_part;

            $out = new \stdClass();
            $out->whole = $whole_part;
            $out->fractional = $fractional_part * 60;

            return $out;
        };

        $prov_1 = $prov($float);
        $prov_2 = $prov($prov_1->fractional);
        $prov_3 = $prov($prov_2->fractional);

        $dms = new \stdClass();
        $dms->d = $prov_1->whole;
        $dms->m = $prov_2->whole;
        $dms->s = $prov_3->whole;
        $dms->str = sprintf('%d°%d′%d″', $dms->d, $dms->m, $dms->s);

        return $dms;
    }
public function dms ( ) { $ float = abs ( $ this -> deg ( ) ) ; $ prov = function ( $ float ) { $ whole_part = ( integer ) $ float ; $ fractional_part = $ float - $ whole_part ; $ out = new \ stdClass ( ) ; $ out -> whole = $ whole_part ; $ out -> fractional = $ fractional_part * 60 ; return $ out ; } ; $ prov_1 = $ prov ( $ float ) ; $ prov_2 = $ prov ( $ prov_1 -> fractional ) ; $ prov_3 = $ prov ( $ prov_2 -> fractional ) ; $ dms = new \ stdClass ( ) ; $ dms -> d = $ prov_1 -> whole ; $ dms -> m = $ prov_2 -> whole ; $ dms -> s = $ prov_3 -> whole ; $ dms -> str = sprintf ( '%d°%d′%d″', $dm s > d,  $d m s > m,  $d m s > s); return $ dms ; }
Gets angle as a "Degrees/Minutes/seconds" object.

DMS object returned as 4 attributes:

- `d` for degrees,
- `m` for minutes,
- `s` for seconds,
- `str` for the DMS string (`34°56′23″`)

@access public
@return stdClass
Gets angle as a Degrees / Minutes / seconds object .