title: Scale and interpolate an array
body: <p>I have a simple 1D array with some numbers (which do NOT represent anything that have to do with an image), and four elements containing e.g.</p>
  
  <pre><code>1 5 9 13
  </code></pre>
  
  <p>Now I want to scale this array by a factor of 3 to a size of 12 elements and interpolate the contained numbers in the new array elements linearly. So after this scale-operation the new array would contain for this example the following values:</p>
  
  <pre><code>1 2 3 4 5 6 7 8 9 10 11 12 13
  </code></pre>
  
  <p>My question: is there any standard C/C++ function/library/code available for this performing such an operation with different array sizes and factors? This sounds for me like it could be a standard problem where one would not have to re-invent the wheel again.</p>
  
  <p>Thanks!</p>