getCentroid

fun getCentroid(shape: Shape): Point2D

Returns a Point2D object that represents the center of mass of the given shape.

Return

a Point2D object that represents the center of mass of the given shape

Parameters

shape