FindIntersection() public method

public FindIntersection ( ILineSegment testSegment, ILineSegment &intersection, Point &intersectionCoordinates ) : bool
testSegment ILineSegment
intersection ILineSegment
intersectionCoordinates Point
return bool
Esempio n. 1
0
        public bool TriangulateClosestEndPoint(ILineSegment intersectingLineSegment, out Point closestPoint)
        {
            ILineSegment pointASegment = new LineSegment(intersectingLineSegment.PointA, TriangulationPoint);
            ILineSegment pointBSegment = new LineSegment(intersectingLineSegment.PointB, TriangulationPoint);

            IntersectionDetector detector = new IntersectionDetector();

            detector.Add(pointASegment);
            detector.Add(pointBSegment);

            ILineSegment closestSegment;
            Point        closestSegmentIntersectionPoint;

            ILineSegment segment = new LineSegment(this.PointA, this.PointB, this.TriangulationPoint, true);

            if (detector.FindIntersection(segment, out closestSegment, out closestSegmentIntersectionPoint))
            {
                closestPoint = closestSegment.PointA;

                return(true);
            }
            else
            {
                closestPoint = new Point(0, 0);

                return(false);
            }
        }
Esempio n. 2
0
        public bool TriangulateClosestEndPoint(ILineSegment intersectingLineSegment, out Point closestPoint)
        {
            ILineSegment pointASegment = new LineSegment(intersectingLineSegment.PointA, TriangulationPoint);
            ILineSegment pointBSegment = new LineSegment(intersectingLineSegment.PointB, TriangulationPoint);

            IntersectionDetector detector = new IntersectionDetector();

            detector.Add(pointASegment);
            detector.Add(pointBSegment);

            ILineSegment closestSegment;
            Point closestSegmentIntersectionPoint;

            ILineSegment segment = new LineSegment(this.PointA, this.PointB, this.TriangulationPoint, true);

            if (detector.FindIntersection(segment, out closestSegment, out closestSegmentIntersectionPoint))
            {
                closestPoint = closestSegment.PointA;

                return true;
            }
            else
            {
                closestPoint = new Point(0, 0);

                return false;
            }
        }