Ejemplo n.º 1
0
        private static Point GetCircumCenter(Point firstPt, Point secondPt, Point thirdPt, Vector normal)
        {
            var one = firstPt.PointEntity;
            var two = secondPt.PointEntity;
            var thr = thirdPt.PointEntity;

            using (IPlaneEntity planeOfCircle = HostFactory.Factory.PlaneByOriginNormal(one, normal.IVector))
            {
                using (ILineEntity perpBisector1 = GetPerpBisector(firstPt, secondPt, planeOfCircle))
                {
                    using (ILineEntity perpBisector2 = GetPerpBisector(secondPt, thirdPt, planeOfCircle))
                    {
                        IPointEntity[] circumCntr = perpBisector1.IntersectWith(perpBisector2);
                        if (circumCntr == null || circumCntr.Length < 1)
                        {
                            return(null);
                        }
                        return(circumCntr[0].ToPoint(false, null));
                    }
                }
            }
        }