Hi,

I want to compute the distance. While x and y coordinates are in two different dataframes. Now we let all but the first column be subtracted from the first column. So we may compute (x1-x)^2, (x2-x)^2, (x3-x)^2, (y1-y)^2, (y2-y)^2, (y3-y)^2. And then we may compute the distance, sqrt( (x1-x)^2+(y1-y)^2), sqrt( (x2-x)^2+(y2-y)^2), sqrt( (x3-x)^2+(y3-y)^2). And then all the distance may form a new dataframe, col and row numbers are equal to d1, 6 rows and 4 cols.

Well, i could only calculate square value about x and y separately. What's more, if there is NA in d1 and d2, method would be different? Thank you in advance.

```
d1<-data.frame(x=c(10.3,13.4,14.3,16.4,17.4,19.1),
x1=c(9.6,13,13.4,17.4,18,19.2),
x2=c(10.1,12.7,15.5,15.5,18.4,20.1),
x3=c(9.2,12.7,13,15.8,16.4,20.2))
d2<-data.frame(y=c(10.1,13.3,13.3,13.7,14.2,11.4),
y1=c(10.5,13.2,13.3,14.2,14.9,16.5),
y2=c(9.1,13.2,12.8,12.8,14,11.6),
y3=c(10.8,12.9,13.2,11.9,13.7,11))
d3<-(d1-d1[,1])^2
d4<-(d2-d2[,1])^2
```

^{Created on 2022-11-05 with reprex v2.0.2}