I'm interested in finding the centroid of a point cloud. I understand that to do this I need to convert latitude and longitude values to 3d coordinates, average them and then convert the resulting coordinate back to latitude and longitude (From a previous answer: https://gis.stackexchange.com/a/6026/8891).
How would I go about doing this (preferably in either QGIS or R)? Is there an appropriate formula which I can recreate in R or a function already available in QGIS?
The main aim of this is to identify the following: If each point in the point cloud was a person, and all the people had to travel (as the crow flies) to a single point, which point would minimise the total distance travelled by the whole group?