Exemple #1
0
        //TODO:此方法可能存在问题
        public static bool IsLineOnArc(UnitPoint p1, UnitPoint p2, UnitPoint center, float radius, double startAngle, double angleSweep, bool clockwise, float thWidth)
        {
            List <UnitPoint> unitPoints = HitUtil.GetIntersectPointLineWithCircle(p1, p2, center, radius, thWidth);

            for (int i = 0; i < unitPoints.Count; i++)
            {
                double angle = HitUtil.LineAngleR(center, unitPoints[i], 0);
                angle = HitUtil.RadiansToDegrees(angle);
                double sweepAngle = HitUtil.CalAngleSweep(startAngle, angle, clockwise);
                if (Math.Abs(angleSweep) > Math.Abs(sweepAngle))
                {
                    return(true);
                }
            }
            return(false);
        }