add test onSegment and in Triangle method

add test onSegment and in Triangle method