I used the following and itsit is working now. Let me know if you have any suggestion.
norm_vec <- function(x) sqrt(sum((x[1]-data_ref$x)^2+(x[2]-data_ref$x)^2))-sum(data_ref$r)
nlm(norm_vec,c(mean(data_ref$x),mean(data_ref$y)))
I am yet to find the confidence interval. How to do that i dont know.
norm_vec <- function(x) sqrt(sum((x[1]-data_ref$x)^2+(x[2]-data_ref$x)^2))-sum(data_ref$r)
nlm(norm_vec,c(mean(data_ref$x),mean(data_ref$y)))