예제 #1
0
        public Angles Sum(Angles[] a)
        {
            Angles c = new Angles();

            foreach (Angles s in a)
            {
                c.degrees += s.degrees;
                c.minutes += s.minutes;
                c.seconds += s.seconds;
            }

            if (c.seconds >= 60)
            {
                int rez = c.seconds % 60;
                int dec = c.seconds / 60;
                c.minutes += dec;
                c.seconds  = rez;
            }

            if (c.minutes >= 60)
            {
                int rez = c.minutes % 60;
                int dec = c.minutes / 60;
                c.degrees += dec;
                c.minutes  = rez;
            }

            if (c.degrees >= 360)
            {
                int rez = c.degrees % 360;
                c.degrees = rez;
            }
            return(c);
        }
예제 #2
0
        public int CompareTo(object obj)
        {
            Angles ob = (Angles)obj;

            //if (ob != null)
            return(this.seconds.CompareTo(ob.seconds));
            //else throw new Exception("Exception");
        }