public static string ToString(DegreeMinutesSeconds dms, AngleFormat format, int precision)
        {
            switch (format)
            {
            // todo here do we need to combine min and sec ??? or we need diffrent format option
            case AngleFormat.Degrees:
                return(string.Format("{0:D}°", dms.Degrees));

            case AngleFormat.DegreesMinutes:
                return(string.Format("{0:D}°{1:D}'", dms.Degrees, dms.Minutes));

            case AngleFormat.DegreesMinutesSeconds:
                var secondsPrecisionFormat = "F" + Math.Abs(precision).ToString("D");

                //string d = dms.Degrees.ToString("");

                //CultureInfo currentCulture = CultureInfo.CurrentCulture;
                var stringFormat = "{0:F0}° {1:F0}' {2:" + secondsPrecisionFormat + "}\"";
                return(string.Format(stringFormat, dms.Degrees, dms.Minutes, dms.Seconds));

            case AngleFormat.Radians:
                // todo convert to radians ??
                break;
            }

            throw new ArgumentOutOfRangeException("format");
        }
 public static Radian ToRadian(DegreeMinutesSeconds dms)
 {
     return(ToRadian(dms.Degrees + dms.Minutes / 60 + dms.Seconds / 3600));
 }
 public static Degree ToDegree(DegreeMinutesSeconds dms)
 {
     // todo seems sign problem here
     return(dms.Degrees + dms.Minutes / 60 + dms.Seconds / 3600);
 }