In this problem, you are required to write a C program in order to calculate the geometric center of any given 2D triangle, see the following figure:

Note that we do not require you to draw such an image; only necessary parameters for the geometric center are required to be output. Thus, you will input three 2D vertex coordinates, and then output the geometric center of this triangle as well as the maximum and minimum distance from this geometric center to the 3 given vertices.
Note that there are multiple methods to compute the center coordinates. The simplest method is,

wherex1, x2, x3
are x coordinates of three inputs;y1, y2, y3
are y
coordinates of three inputs;
And the distance between two points can be calculated as

The following is a demo process for the program if you can do it successfully: (red indicates input)

The input contains3 lines
, for each line, it
containstwo floating point numbers
, indicating
thex coordinate
andy coordinate
for a vertex in the triangle.
* Note that we assume all inputs are valid! (It means you do not need to consider the illegal cases)
1. output a prompt"Input vertex 1: "
, then, receive two inputs.
2. output a prompt"Input vertex 2: "
, then, receive two inputs.
3. output a prompt"Input vertex 3: "
, then, receive two inputs.
4. output a prompt"The center of the triangle is: "
, and followed by the values
ofcenter_x
andcenter_y
5. output a prompt"The maximum distance between center and vertices: "
, and then the
maximum distance between the center and the vertices.
6. output a prompt"The minimum distance between center and vertices: "
, and then the
minimum distance between the center and vertices.
* Center coordinates should be printed with “printf” to display only 1 decimal point digit, and distances should be printed with “printf” to display only 2 decimal point digit.
* The values of coordinates are between -10000.0 and 10000.0.
* (The quotation marks are not to be printed.)
0.0 1.0
-1.0 0.0
1.0 0.0
Input vertex 1: Input vertex 2: Input vertex 3: The center of the triangle is: 0.0 0.3
The maximum distance between center and vertices: 1.05
The minimum distance between center and vertices: 0.67