fixed segmentByTwoPoints