Centroid of a set of N-dimensional points: Difference between revisions

m
(julia example)
Line 40:
arr[i] += x
end
return Point{T, N}(sum.(arr) / length(points))
end
 
Line 63:
println("$t => $(centroid(vvec))")
end
xyz = [p[1] for p in testvecstests[4]], [p[2] for p in testvecstests[4]], [p[3] for p in testvecstests[4]]
cpoint = centroid(testvecstests[4]).v
for i in eachindex(cpoint)
push!(xyz[i], cpoint[i])
4,102

edits