Hello,

I have a dataset as following :

```
id x.from y.from x.to y.to
1 573346934 340391 510136 340361 510250
2 573347081 342842 508754 342797 508778
3 573347082 342646 508813 342797 508778
... ... ... ... ... ...
```

'x.from' and 'x.to' here are longitude, and 'y.from' and 'y.to' are latitude.

Thus, there is an 'origin point'(from) and 'destination point'(to) in each 'id'. I want to calculate the distance between two points of each ids.

I have major radius of the ellipsoid = 6378137, and flattening = 1/298.257222101.

All the examples using geospatial related functions give output as matrix, but what I have to get is not in that kind of form. I need a column that matches the values of each id's distance with the ids.

I would be very appreciate if you tell me how to solve this problem...