Answer:
void distance(int x1, int x2, int y1, int y2){
pointsDistance = sqrt((x2-x1)^(2) + (y2-y1)^(2));
}
Explanation:
Suppose we have two points:
![A = (x_(1), y_(1))](https://img.qammunity.org/2021/formulas/mathematics/college/n6nxpxqnjal1u6g0aped7ip2povbojz51c.png)
![B = (x_(2), y_(2)](https://img.qammunity.org/2021/formulas/mathematics/college/t3hh93rgl3ho4rtnbq70w4m7446if44dxe.png)
The distance between these points is:
![D = \sqrt{(x_(2) - x_(1))^(2) + (y_(2) - y_(1))^(2)}](https://img.qammunity.org/2021/formulas/mathematics/college/guhtemg4n0chetkfxc1h7gpjpy5o3a6cdc.png)
So, for points (1.0, 2.0) and (1.0, 5.0)
![D = \sqrt{(1 - 1)^(2) + (5 - 2)^(2)} = √(9) = 3](https://img.qammunity.org/2021/formulas/mathematics/college/xlpjzkhu1ovlvu0bhu3eswatkqucdql6ja.png)
I suppose this questions asks me to write a code, since i have to attribute the result to pointsDistance. I am going to write a C code for this, and you have to include the math.h library.
void distance(int x1, int x2, int y1, int y2){
pointsDistance = sqrt((x2-x1)^(2) + (y2-y1)^(2));
}