 <p>To find the intersection of two curves:</p> <p>Declare g1 and g2 as explicit anonymous functions</p> <pre><code>g1 = @(x)(sqrt(2*x - 1)); g2 = @(x)(-0.4*x.^2 + 4.5); </code></pre> <p>Choose a range for x to test over:</p> <pre><code>xmin = 0; xmax = 100; xres = 0.1; x = xmin:xres:xmax; </code></pre> <p>Find in the curves</p> <pre><code>G1 = g1(x); G2 = g2(x); </code></pre> <p>Now find the index where the graphs cross each other:</p> <pre><code>ind = find(diff(G1 &gt; G2)); </code></pre> <p>Now it's easy to convert that index to an <code>x</code> value:</p> <pre><code>xval = xmin + (ind(1)-1)*xres </code></pre> <p><strong>EDIT:</strong></p> <p>So I'm assuming now that your (V1,V2) is just a unit direction vector from the origin? If so we can create a straight line y = mx+c and find where that intersect g1 and g2. </p> <pre><code>m = V2/V1; c = Y - m*X; line = @(x)(m*x + c); </code></pre> <p>now just follow the procedure above to find the point of intersection of <code>line</code> and <code>g1</code> and also of <code>line</code> and <code>g2</code>. If V1 is negative, then set <code>xmax = X</code> otherwise set <code>xmin = X</code> so that you look for the intersection point in the right direction. The <code>xval</code> line will probably error if there is no point of intersection so add some error checking in there. And then just pick the smallest xval if V1 was positive or the larger if V1 is negative</p> <pre><code>if V1 &gt;= 0 xmin = X; xmax = X + 100; else xmin = X - 100; xmax = X; end; xres = 0.1; x = xmin:xres:xmax; G1 = g1(x); G2 = g2(x); L = line(x); ind1 = find(diff(G1 &gt; L)); xval1 = xmin + (ind1(1)-1)*xres ind2 = find(diff(G2 &gt; L)); xval2 = xmin + (ind2(1)-1)*xres xval = (V1 &gt; 0)*max(xval1, xval2) + (V2 &lt; 0)*max(xval1, xval2); yval = line(xval); </code></pre>