コード例 #1
0
ファイル: Intersection.cs プロジェクト: AmrFayez/SimpleEditor
        public static IntersectionResult ParabolaRectangle(GCurve c, GRectangle r)
        {
            IntersectionResult result = new IntersectionResult();

            foreach (var line in r.Lines)
            {
                var temp = CurveLine(c, line);
                if (temp.IntersectionPoints.Count != 0)

                {
                    result.IntersectionPoints.AddRange(temp.IntersectionPoints);
                }
            }
            return(result);
        }
コード例 #2
0
ファイル: Intersection.cs プロジェクト: AmrFayez/SimpleEditor
        public static IntersectionResult CircleRectangle(GCircle circle, GRectangle rec)
        {
            var result = new IntersectionResult();

            foreach (var line in rec.Lines)
            {
                var intersect = CircleLine(circle, line);
                if (intersect.IntersectionPoints.Count > 0)
                {
                    result.IntersectionPoints.
                    AddRange(intersect.IntersectionPoints);
                }
            }
            return(result);
        }