added new function to Path.js ( getCentroid() )