コード例 #1
0
        public override string ToString()
        {
            string res = "";

            res += "A: " + _a.ToString() + " B: " + _b.ToString();
            if ((!_halfplane))
            {
                res += " C: " + _c.ToString();
            }
            return(res);
        }
コード例 #2
0
        /// <summary>
        /// Constructs a triangle form 3 point - store it in counterclockwised order.
        /// A should be before B and B before C in counterclockwise order.
        /// </summary>
        /// <param name="A"></param>
        /// <param name="B"></param>
        /// <param name="C"></param>
        /// <remarks></remarks>
        public Triangle_dt(Point_dt A, Point_dt B, Point_dt C)
        {
            _a = A;
            int res = C.pointLineTest(A, B);

            if ((res <= Point_dt.LEFT | (res == Point_dt.INFRONTOFA | res == Point_dt.BEHINDB)))
            {
                _b = B;
                _c = C;
                //RIGHT
            }
            else
            {
                Console.WriteLine("Warning, Triangle_dt(A,B,C) expects points in counterclockwise order.");
                Console.WriteLine(A.ToString() + B.ToString() + C.ToString());
                _b = C;
                _c = B;
            }
            circumcircle();
        }