title: solving two linear equation in program
body: <p>I have two lines UV and PQ, with U(15,10) V(50,25) and P(40,10) and Q(30,30).</p>
  
  <p>and i am finding a point of intersection between these two points.
  I am forming two linear equations for that:</p>
  
  <p>eq 1:</p>
  
  <pre class="lang-none prettyprint-override"><code>Ux + t(Vx-Ux) = Px +s(Qx-Px)
  </code></pre>
  
  <p>eq2</p>
  
  <p>I want to solve these equations using C program to get the value of either t or s.</p>
  
  <p>I used the <code>t</code> from second equation and substituted it in first equation to get a formula to find s. But it did not work out. How can I solve this in a program?</p>