Logo Search packages:      
Sourcecode: hamlib version File versions  Download package

double HAMLIB_API dmmm2dec ( int  degrees,
double  minutes,
int  sw 
)

Convert D M.MMM notation to decimal degrees.

Parameters:
degrees Degrees, whole degrees
minutes Minutes, decimal minutes
sw South or West
Convert a degrees, decimal minutes notation common on many GPS units to its decimal degrees value.

degrees > 360, minutes > 60.0 are allowed, but resulting angle won't be normalized.

When the variable sw is passed a value of 1, the returned decimal degrees value will be negative (south or west). When passed a value of 0 the returned decimal degrees value will be positive (north or east).

Returns:
The angle in decimal degrees.
See also:
dec2dmmm()

Definition at line 183 of file locator.c.

                                                                {
      double st;

      if (degrees < 0)
            degrees = abs(degrees);
      if (minutes < 0)
            minutes = fabs(minutes);

      st = (double)degrees + minutes / 60.;

      if (sw == 1)
            return -st;
      else
            return st;
}


Generated by  Doxygen 1.6.0   Back to index