#NEWLINE# def get_center_pt( self , closed = True ) : #NEWLINE# #INDENT# if closed : #NEWLINE# #INDENT# P = numpy . array ( ( self . points + [ self . points [ 0 ] ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# P = numpy . array ( self . points ) #NEWLINE# #UNINDENT# x = P [ : , 0 ] #NEWLINE# y = P [ : , 1 ] #NEWLINE# a = ( x [ : ( - 1 ) ] * y [ 1 : ] ) #NEWLINE# b = ( y [ : ( - 1 ) ] * x [ 1 : ] ) #NEWLINE# A = ( numpy . sum ( ( a - b ) ) / 2.0 ) #NEWLINE# cx = ( x [ : ( - 1 ) ] + x [ 1 : ] ) #NEWLINE# cy = ( y [ : ( - 1 ) ] + y [ 1 : ] ) #NEWLINE# Cx = ( numpy . sum ( ( cx * ( a - b ) ) ) / ( 6.0 * A ) ) #NEWLINE# Cy = ( numpy . sum ( ( cy * ( a - b ) ) ) / ( 6.0 * A ) ) #NEWLINE# return ( Cx , Cy )