title: How to detect if there is an object between two points in a 2D plane?
body: <p>I created a 2D plane using matplotlib and have generated a user-entered amount of randomly placed triangles. Given two(2) random points, an origin, and an endpoint, how would I go about detecting if the line segment created would touch or intersect one of the shapes? In the photo provided, how could I assure the program detected the line intersected the triangle?</p>
  
  <p><a href="https://i.stack.imgur.com/gl28R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gl28R.png" alt="enter image description here"></a></p>