question: public double distance_to_the_left ( PlaLineInt p_line ) { double result = Integer . MAX_VALUE ; for ( int index = 0 ; index < border_line_count ( ) ; ++ index ) { PlaPointFloat curr_corner = corner_approx ( index ) ; PlaSide line_side = p_line . side_of ( curr_corner , 1 ) ; if ( line_side == PlaSide . COLLINEAR ) { line_side = p_line . side_of ( corner ( index ) ) ; } if ( line_side == PlaSide . ON_THE_RIGHT ) return - 1 ; result = Math . min ( result , p_line . distance_signed ( curr_corner ) ) ; } return result ; }
target:  Calculates the minimal distance of p_line to this shape, assuming, that p_line is on the left of this shape. 