How to write a generator for this function
<p>For some bizarre reason, I am struggling to get my head around iterators/generators as used in Python (I write/use them with no problem in C++ - but somehow I can't seem to grok how to write one using Python).</p>

<p>I have a mathematical function of the form:</p>

<p><code>f(a,b) = ( v1(a) - v1(b) ) / ( v2(a) - v2(b) )</code></p>

<p>Where v1 and v2 are equal length 1D vectors.</p>

<p>I want to write a function (actually, a generator), that generates the output of f() as defined above.</p>

<p>Can anyone help?</p>

<p><strong>[[Edit]]</strong></p>

<p>My notation may have been confusing. I hope to clarify that. The function described above return a <strong>set</strong> of values. With the argument b taking on values, in the interval <code>(a,b]</code></p>

<p>So for example if we call <code>f(1,5)</code>, the function will return the following <strong>values</strong> (not functions -in case my clarification below causes further confusion):</p>

<pre><code>f(1,1)
f(1,2)
f(1,3)
f(1,4)
f(1,5)
</code></pre>
