Example #1
0
        public static string ToStringDecimal(double latitude, double longitude, bool newline = false, int precision = 3)
        {
            double clampedLongitude = MuUtils.ClampDegrees180(longitude);
            double latitudeAbs      = Math.Abs(latitude);
            double longitudeAbs     = Math.Abs(clampedLongitude);

            return(latitudeAbs.ToString("F" + precision) + "° " + (latitude > 0 ? "N" : "S") + (newline ? "\n" : ", ")
                   + longitudeAbs.ToString("F" + precision) + "° " + (clampedLongitude > 0 ? "E" : "W"));
        }
Example #2
0
        public EditableAngle(double angle)
        {
            angle = MuUtils.ClampDegrees180(angle);

            negative = (angle < 0);
            angle    = Math.Abs(angle);
            degrees  = (int)angle;
            angle   -= degrees;
            minutes  = (int)(60 * angle);
            angle   -= minutes / 60;
            seconds  = Math.Round(3600 * angle);
        }
Example #3
0
 public string ToString(string format)
 {
     return(MuUtils.PrettyPrint(value, format));
 }