#NEWLINE# def compute_rect_vertices( fromp , to , radius ) : #NEWLINE# #INDENT# ( x1 , y1 ) = fromp #NEWLINE# ( x2 , y2 ) = to #NEWLINE# if ( abs ( ( y1 - y2 ) ) < 1e-06 ) : #NEWLINE# #INDENT# dx = 0 #NEWLINE# dy = radius #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dx = ( ( radius * 1.0 ) / ( ( ( ( ( x1 - x2 ) / ( y1 - y2 ) ) ** 2 ) + 1 ) ** 0.5 ) ) #NEWLINE# dy = ( ( ( radius ** 2 ) - ( dx ** 2 ) ) ** 0.5 ) #NEWLINE# dy *= ( ( - 1 ) if ( ( ( x1 - x2 ) * ( y1 - y2 ) ) > 0 ) else 1 ) #NEWLINE# #UNINDENT# return ';' . join ( map ( ( lambda r : ',' . join ( map ( str , r ) ) ) , [ [ ( radius + dx ) , ( y1 + dy ) ] , [ ( x2 + dx ) , ( y2 + dy ) ] , [ ( x2 - dx ) , ( y2 - dy ) ] , [ ( x1 - dx ) , ( y1 - dy ) ] ] ) )