How would you modify elements of an array as a vector?
<p>I have some cartesian points (i.e. array of two values):</p>

<pre><code>p0 = [0, 0]
p1 = [20, 20]
</code></pre>

<p>I need to do some math over it such as <code>(t+2)*p0</code> or <code>(m/v+2)/p1</code>. I need to modify each element of the array. How would you do this efficiently? My code is something like this:</p>

<pre><code>pT = [(t + 2) * p0[0], (t + 2) * p0[1]]
</code></pre>

<p>but it looks terrible to read. Is there a better way that is more in line with the math form?</p>