title: How can I find the general form equation of a line from two points?
body: <p>Given the input:</p>
  
  <pre class="lang-vb prettyprint-override"><code>double x1,y1,x2,y2;
  </code></pre>
  
  <p>How can I find the general form equation (double a,b,c where ax + by + c = 0) ?</p>
  
  <p>Note: I want to be able to do this computationally. So the equivalent for slope-intercept form would be something like:</p>
  
  <pre class="lang-vb prettyprint-override"><code>double dx, dy;
  double m, b;
  
  dx = x2 - x1;
  dy = y2 - y1;
  m = dy/dx;
  b = y1;
  </code></pre>
  
  <p>Obviously, this is very simple, but I haven't been able to find the solution for the general equation form (which is more useful since it can do vertical lines). I already looked in my linear algebra book and two books on computational geometry (both too advanced to explain this).</p>