示例#1
0
 /// <summary>
 ///   Checks if the passed line segments intersect and computes the intersection point if they do
 /// </summary>
 /// <param name="lineSegmentA"> </param>
 /// <param name="lineSegmentB"> </param>
 /// <param name="intersectionPoint"> Intersection point between the two passed line segments </param>
 /// <returns> Returns true if line segments intersect, otherwise false </returns>
 public static bool Intersect(
     LineSegment2F lineSegmentA, LineSegment2F lineSegmentB, out Vector2F intersectionPoint)
 {
     return(Intersect(
                lineSegmentA.PointA,
                lineSegmentA.PointB,
                lineSegmentB.PointA,
                lineSegmentB.PointB,
                out intersectionPoint));
 }
示例#2
0
        /// <summary>
        ///   Checks if the passed line segments intersect
        /// </summary>
        /// <param name="lineSegmentA"> </param>
        /// <param name="lineSegmentB"> </param>
        /// <returns> Returns true if line segments intersect, otherwise false </returns>
        public static bool Intersect(LineSegment2F lineSegmentA, LineSegment2F lineSegmentB)
        {
            // TODO: This can be made faster because we don't need to compute the intersection point
            Vector2F intersectionPoint;

            return(Intersect(
                       lineSegmentA.PointA,
                       lineSegmentA.PointB,
                       lineSegmentB.PointA,
                       lineSegmentB.PointB,
                       out intersectionPoint));
        }
 /// <summary>
 ///   Checks if the passed line segments intersect
 /// </summary>
 /// <param name="lineSegmentA"> </param>
 /// <param name="lineSegmentB"> </param>
 /// <returns> Returns true if line segments intersect, otherwise false </returns>
 public static bool Intersect(LineSegment2F lineSegmentA, LineSegment2F lineSegmentB)
 {
     // TODO: This can be made faster because we don't need to compute the intersection point
     Vector2F intersectionPoint;
     return Intersect(
         lineSegmentA.PointA,
         lineSegmentA.PointB,
         lineSegmentB.PointA,
         lineSegmentB.PointB,
         out intersectionPoint);
 }
 /// <summary>
 ///   Checks if the passed line segments intersect and computes the intersection point if they do
 /// </summary>
 /// <param name="lineSegmentA"> </param>
 /// <param name="lineSegmentB"> </param>
 /// <param name="intersectionPoint"> Intersection point between the two passed line segments </param>
 /// <returns> Returns true if line segments intersect, otherwise false </returns>
 public static bool Intersect(
     LineSegment2F lineSegmentA, LineSegment2F lineSegmentB, out Vector2F intersectionPoint)
 {
     return Intersect(
         lineSegmentA.PointA,
         lineSegmentA.PointB,
         lineSegmentB.PointA,
         lineSegmentB.PointB,
         out intersectionPoint);
 }