#NEWLINE# def normalize( vector ) : #NEWLINE# #INDENT# 'Normalizes the `vector` so that its length is 1. `vector` can have\n    any number of components.\n    ' #NEWLINE# d = ( sum ( ( ( x * x ) for x in vector ) ) ** 0.5 ) #NEWLINE# return tuple ( ( ( vector / d ) for x in vector ) )