add segment_in_triangle with tests