Okay, I'm a little annoyed by the amount of if statements I've had to use here. We have to figure out the distances of the centroid of a triangle to the 3 points of the triangles and list them in increasing order. Here's my code in that calculation so far:

This satisfies some of the instances. BUT, if two or more of the x or y coordinates of the triangle points are equal to each other, it obviously won't output the travel distances. I want to know if I have to keep writing if statements to satisfy the rest of the instances, or if there is an easier way to represent the instances without writing an if statement for each... :P (I HOPE THIS MAKES SENSE)Code:if(distance_1 > distance_2 && distance_3 < distance_2) printf("The corresponding travel distances are: %.2lf, %.2lf and %.2lf.\n", distance_3, distance_2, distance_1); if(distance_1 < distance_2 && distance_3 > distance_2) printf("The corresponding travel distances are: %.2lf, %.2lf and %.2lf.\n", distance_1, distance_2, distance_3); if(distance_2 < distance_1 && distance_3 > distance_1) printf("The corresponding travel distances are: %.2lf, %.2lf and %.2lf.\n", distance_2, distance_1, distance_3); if(distance_1 < distance_3 && distance_2 > distance_3) printf("The corresponding travel distances are: %.2lf, %.2lf and %.2lf.\n", distance_1, distance_3, distance_2); if(distance_2 < distance_3 && distance_1 > distance_3) printf("The corresponding travel distances are: %.2lf, %.2lf and %.2lf.\n", distance_2, distance_3, distance_1); if(distance_3 < distance_1 && distance_2 > distance_1) printf("The corresponding travel distances are: %.2lf, %.2lf and %.2lf.\n", distance_3, distance_1, distance_2);