def flat(x, y, z, eps=0.001):
 np = import_module('numpy')
 vector_a = (x - y).astype(np.float)
 vector_b = (z - y).astype(np.float)
 dot_product = np.dot(vector_a, vector_b)
 vector_a_norm = np.linalg.norm(vector_a)
 vector_b_norm = np.linalg.norm(vector_b)
 cos_theta = (dot_product / (vector_a_norm * vector_b_norm))
 return (abs((cos_theta + 1)) < eps)

def flat ( x , y , z , eps = 0.001 ) : np = import_module ( 'numpy' ) vector_a = ( x - y ) . astype ( np . float ) vector_b = ( z - y ) . astype ( np . float ) dot_product = np . dot ( vector_a , vector_b ) vector_a_norm = np . linalg . norm ( vector_a ) vector_b_norm = np . linalg . norm ( vector_b ) cos_theta = ( dot_product / ( vector_a_norm * vector_b_norm ) ) return ( abs ( ( cos_theta + 1 ) ) < eps )
flat flattens the arguments into a string .