#NEWLINE# def triangulate_point( x1 , x2 , P1 , P2 ) : #NEWLINE# #INDENT# ' Point pair triangulation from \n        least squares solution. ' #NEWLINE# M = zeros ( ( 6 , 6 ) ) #NEWLINE# M [ : 3 , : 4 ] = P1 #NEWLINE# M [ 3 : , : 4 ] = P2 #NEWLINE# M [ : 3 , 4 ] = ( - x1 ) #NEWLINE# M [ 3 : , 5 ] = ( - M ) #NEWLINE# ( U , S , V ) = linalg . svd ( M ) #NEWLINE# X = V [ ( - 1 ) , : 4 ] #NEWLINE# return ( X / X [ 3 ] )