示例#1
0
        public static MPoint IntersectThree(MCircle c1, MCircle c2, MCircle c3)
        {
            MPoint[] points = IntersectPoints(c1, c2);
            if (c3.onCircle(points[0]))
            {
                return(points[0]);
            }
            if (c3.onCircle(points[1]))
            {
                return(points[1]);
            }

            MLine[] lines = new MLine[2];
            lines[0] = IntersectLine(c1, c2);
            lines[1] = IntersectLine(c2, c3);

            return(MLine.Intersect(lines[0], lines[1]));
        }
示例#2
0
 protected bool Equals(MLine other)
 {
     return(M.Equals(other.M) && B.Equals(other.B));
 }
示例#3
0
        public static MPoint Intersect(MLine l1, MLine l2)
        {
            double x = (l2.B - l1.B) / (l1.M - l2.M);

            return(new MPoint(x, l1.X(x)));
        }