I have bunch of cartesian-3D points. Is there a function/procedure to calculate center point, positioned after calculating distances from each node? I want to create a new node, that would represent the points it was calculated from.
There's no reason to calculate distances between points. Instead you can deconstruct each point and calculate the average of each individual dimension. Try out the code below. Put any number of points in there that you desire and it will provide you with the average of all 3 dimensions.
WITH [point({ x: 2.3, y: 4.5, z: 2 }), point({ x: 2.3, y: 4.5, z: 4 })] AS points
UNWIND points AS point
WITH avg(point.x) AS avgx, avg(point.y) AS avgy, avg(point.z) AS avgz
RETURN point({ x: avgx, y: avgy, z: avgz }) AS avgpoint;
@tony.chiboucas you are right that this does not work for geographic points, but it does work as @mojo2go said for 3D cartesian points.
For geographic data you would first need to define what is meant by the term 'center point', which could mean a point on the direct line through the earth, or a point on the surface of the earth. Two completely different definitions with two completely different mathematical solutiuons. For some cases the second definition leads to infinite solutions.