title: Dividing a line/curve into certain number of points and extract the co-ordinates
body: <p>I have a dataframe of a plot, which looks like this: <a href="https://i.stack.imgur.com/AWy3Y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AWy3Y.jpg" alt="enter image description here" /></a></p>
  <p>Here are the coordinates of this plot:</p>
  <pre><code>x &lt;- ( -9.736384, -8.113654, -6.490923, -4.868192, -3.245462, -1.622731,  0.000000,  1.622731,  3.245462,  4.868193,  6.490923,  8.113654,  9.736385)
  y &lt;- (1.119308090, 0.726472514, 0.423722058, 0.205458581, 0.066083942, 0.000000000, 0.001608615, 0.065311644, 0.185510949, 0.356608386, 0.573005817, 0.829105098, 1.119308090)
  
  df &lt;- data.frame(x=x, y=y)
  </code></pre>
  <p>Plot:</p>
  <pre><code>c &lt;- ggplot(data =  df) + geom_line(aes(x = df$x, y = df$y), colour = &quot;red&quot;, size = 0.5)
  h &lt;- c + xlab(&quot;X (mm)&quot;) + ylab(&quot;Z (um)&quot;)
  ggplotly(h)
  </code></pre>
  <p>I want to increase the number of coordinate points of this curve for e.g. here there are 13 points, I want to divide this curve into say 80 equal parts and extract both x and y coordinates of that.</p>
  <p>My attempt:</p>
  <pre><code>x &lt;- seq(from = df[1,1], to = tail(df,1)[,1], length.out = 80)
  </code></pre>
  <p>This divides the x-coordinates into equal 80 parts.</p>
  <p>Now, how do I predict the corresponding y coordinates of this plot?</p>