title: How to attribute intersection points between poly and lineseg to poly
body: <p>I'm trying to plot an animal's trajectory from a set of coordinates as a line segment. I want to see how many coordinates are plotted inside a circular zone vs outside. I think that coordinates which intersect with the circle are being counted as both inside and outside, but I would like them to be strictly counted as inside. This is what I have so far:</p>
  <pre><code>[in,out] = intersect(circle_poly,trajectory);
  plot(circle_poly)
  hold on
  plot(in(:,1),in(:,2),'b',out(:,1),out(:,2),'r')
  legend('Polygon','Inside','Outside','Location','NorthWest')
  
  num_frames_in = numel([in]) %count num elements/frames in polygon
  num_frames_out = numel([out]) %count num element/frames outside polygon
  total_frames = num_frames_in + num_frames_out
  </code></pre>
  <p>Any help would be really appreciated since I'm new to Matlab!</p>
  <p><a href="https://i.stack.imgur.com/v3Tv3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v3Tv3.png" alt="enter image description here" /></a></p>