title: Need to scale/translate array of points, so the path will match the given end point
body: <p>I have an array of points. I'm looking for a way to scale/translate the whole path so the end point of the path will match the end point I give, but keeping the shape of the points array.</p>
  
  <pre><code>    void translate(Point[] array, Point scaleToPoint)
  </code></pre>
  
  <p>Is there any algorithm that does what I've described? Thank you in advance, any help is really appreciated!</p>
  
  <p><img src="https://i.stack.imgur.com/qGVGl.png" alt="Image example of what I&#39;m looking for">
  <a href="https://i.stack.imgur.com/fPcah.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fPcah.png" alt="enter image description here"></a></p>