title: Determining angles on an SVG path between two lines
body: <p>I'm trying to make my robot follow a path that is a drawn SVG path on a webpage.  To keep it simple, assume that the SVG Is like so:</p>
  
  <pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg"&gt;
    &lt;path id="path" d="M 100 100 L 300 300 L 100 500 z"&gt;
  &lt;/svg&gt;
  </code></pre>
  
  <p>Which makes a triangle.  </p>
  
  <p>The robot will start at 100, 100.  The goal is to get him to move to 300, 300, but I don't know how to get the angle that the robot needs to turn from 100, 100 to start moving towards 300, 300.</p>
  
  <p>I've included a poorly put together image showing the angle I'm trying to get.  Although this is just a simple example that's obviously 90 degrees, I'm using this to figure out how to do it on more complex drawings.</p>
  
  <p>I'm writing this all in javascript.</p>
  
  <p><img src="https://i.stack.imgur.com/c7flH.png" alt="Badly drawn angle image"></p>