public Angular AddSeconds(double seconds) { Angular a = new Angular(this); a.angle += seconds / 3600d; return(a); }
public Angular AddMinutes(int minutes) { Angular a = new Angular(this); a.angle += minutes / 60d; return(a); }
public Angular AddDegrees(int add) { Angular a = new Angular(this); a.angle += add; return(a); }
static public Angular Min(Angular a, Angular b) { if (a <= b) { return(a); } return(b); }
static public Angular Max(Angular a, Angular b) { if (a >= b) { return(a); } return(b); }
/// <summary> /// For a given latitude or longitude angle calculates integer degrees value of the cell to which the angle belongs. /// </summary> /// <param name="angle">The angle.</param> /// <returns>Integer degrees value of the cell to which the angle belongs</returns> static public int CalculateCellDegrees(double angle) { if (angle >= 0) { return(Angular.GetDegrees(angle)); } return(Angular.GetDegreesFloor(angle)); }
public int CompareTo(object obj) { if (obj == null) { return(1); } if (false == obj is Angular) { throw new ArgumentException("Not of Angular type."); } Angular b = (Angular)obj; return(Math.Round(angle, 10).CompareTo(Math.Round(b.angle, 10))); }
static public Angular Divide(Angular a, int div) { return(new Angular(0, 0, (a.Degrees * 3600.0 + a.Minutes * 60 + a.Seconds) / div)); }
static public Angular Subtract(Angular a, Angular b) { return(new Angular(a.Angle - b.Angle)); }
static public Angular Add(Angular a, Angular b) { return(new Angular(a.Angle + b.Angle)); }
static public Angular Negate(Angular a) { return(new Angular(-a.Angle)); }
public void SetDms(int degrees, int minutes, double seconds) { angle = Angular.FromDms(degrees, minutes, seconds); }
public Angular(Angular a) { angle = a.angle; }