#NEWLINE# def get_closest_point_to_point( xy_point ) : #NEWLINE# #INDENT# "\n    Used to find the closest point to an unreproducible Color is unreproducible\n    on each line in the CIE 1931 'triangle'.\n    " #NEWLINE# pAB = get_closest_point_to_line ( Red , Lime , xy_point ) #NEWLINE# pAC = get_closest_point_to_line ( Blue , Red , xy_point ) #NEWLINE# pBC = get_closest_point_to_line ( Lime , Blue , xy_point ) #NEWLINE# dAB = get_distance_between_two_points ( xy_point , pAB ) #NEWLINE# dAC = get_distance_between_two_points ( xy_point , pAC ) #NEWLINE# dBC = get_distance_between_two_points ( xy_point , pBC ) #NEWLINE# lowest = dAB #NEWLINE# closest_point = pAB #NEWLINE# if ( dAC < lowest ) : #NEWLINE# #INDENT# lowest = dAC #NEWLINE# closest_point = pAC #NEWLINE# #UNINDENT# if ( dBC < lowest ) : #NEWLINE# #INDENT# lowest = dBC #NEWLINE# closest_point = pBC #NEWLINE# #UNINDENT# cx = closest_point . x #NEWLINE# cy = closest_point . y #NEWLINE# return XYPoint ( cx , cy )