721
edits
Line 52: | Line 52: | ||
To calculate a centroid of a collection of points (our cluster) we need to do two steps: | To calculate a centroid of a collection of points (our cluster) we need to do two steps: | ||
* sum up our points: | * sum up our points: <syntaxhighlight lang="c++" inline>p0 + p1 + p2 + p3 ... = sum </syntaxhighlight> | ||
<syntaxhighlight lang="c++" inline> | |||
p0 + p1 + p2 + p3 ... = sum | |||
</syntaxhighlight> | |||
* divide the sum by out number of point: | * divide the sum by out number of point: | ||
<syntaxhighlight lang="c++" inline> | <syntaxhighlight lang="c++" inline> |