is_triangle function for day1