Esempio n. 1
0
        /// <summary>
        /// 线圈所在外包矩形的形心
        /// </summary>
        /// <returns></returns>
        static public Vector2d Center(this Polygon2d polygon2d)
        {
            double wight  = 0;
            double height = 0;

            return(polygon2d.Center(ref wight, ref height));
        }
Esempio n. 2
0
        /// <summary>
        /// 线圈所在外包矩形
        /// </summary>
        /// <returns></returns>
        static public Polygon2d BoundingRectangle(this Polygon2d polygon2d)
        {
            //【】下方注释方法的时间需要进行测试
            //Box2d box2D = polygon2d.MinimalBoundingBox(double epsilon)

            double   wight  = 0;
            double   height = 0;
            Vector2d center = polygon2d.Center(ref wight, ref height);

            return(Polygon2d.MakeRectangle(center, wight, height));
        }