#NEWLINE# def curvature( self , u ) : #NEWLINE# #INDENT# d1 = self . derivative ( ) ( u ) #NEWLINE# d2 = self . derivative ( ) . derivative ( ) ( u ) #NEWLINE# num = ( ( d1 . x * d2 . y ) - ( d1 . y * d2 . x ) ) #NEWLINE# den = ( sqrt ( ( ( d1 . x ** 2 ) + ( d1 . y ** 2 ) ) ) ** 3 ) #NEWLINE# if ( den == 0 ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# return abs ( ( num / den ) )