Example #1
0
        public static Cone operator *(Cone x, double y)
        {
            Cone ans = new Cone();

            ans.r = x.r * y;
            ans.h = x.h * y;
            return(ans);
        }
Example #2
0
        public static Cone operator -(Cone x, Cone y)
        {
            Cone ans = new Cone();

            ans.r = x.r - y.r;
            ans.h = x.h - y.h;
            return(ans);
        }
Example #3
0
        public static Cone operator /(Cone x, double y)
        {
            if (y == 0.0)
            {
                throw new DivideByZeroException();
            }
            Cone ans = new Cone();

            ans.r = x.r / y;
            ans.h = x.h / y;
            return(ans);
        }
Example #4
0
        public override bool Equals(object x)
        {
            Cone obj = (Cone)x;

            if (h == obj.h && r == obj.r)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }