title: How to find an intersection of curve and circle?
body: <p>I have a curve, derived from empirical data, and I can obtain a reasonable model of it. I need to identify a point (x, y) where the curve intersects a circle of known center and radius. The following code illustrates the question.</p>
  
  <pre><code>x &lt;- c(0.05, 0.20, 0.35, 0.50, 0.65, 0.80, 0.95, 
     1.10, 1.25, 1.40, 1.55, 1.70, 1.85, 2.00, 
     2.15, 2.30, 2.45, 2.60, 2.75, 2.90, 3.05)
  
  y &lt;- c(1.52, 1.44, 1.38, 1.31, 1.23, 1.15, 1.06,
     0.96, 0.86, 0.76, 0.68, 0.61, 0.54, 0.47, 
     0.41, 0.36, 0.32, 0.29, 0.27, 0.26, 0.26)
  
  fit &lt;- loess(y ~ x, control = loess.control(surface = "direct"))
  newx &lt;- data.frame(x = seq(0, 3, 0.01))
  fitline &lt;- predict(fit, newdata = newx)
  est &lt;- data.frame(newx, fitline)
  
  plot(x, y, type = "o",lwd = 2)
  lines(est, col = "blue", lwd = 2)
  
  library(plotrix)
  draw.circle(x = 3, y = 0, radius = 2, nv = 1000, lty = 1, lwd = 1)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/V8sAF.png" alt="enter image description here"></p>