title: How to compute the intersection points of a line and an arbitrary shape?
body: <p>Is there a way to geometrically compute the intersection points of a line and an arbitrary graphics path?  I know where all of the lines and curves are in the path, and I am using the HTML5 canvas element if that helps any.  Basically, I have access to all of the canvas drawing commands and their arguments. For instance, if the API was called with a lineTo, then a moveTo, then an arc I have all of that information. Each call to the API is stored in an array. I have the path definition, I just want to figure out where the line intersects the path.  Below is an image showing an example of the points I would need to find.</p>
  <p><a href="https://i.stack.imgur.com/ZXr8y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZXr8y.png" alt="alt text" /></a></p>
  
  <p>Thanks for any help!  Again, I would rather do this geometrically rather than pixel based if possible.</p>