231k views
1 vote
In mathematics, the distance between one point (a) and another point (b), each with coordinates (x,y), can be computed by taking the differences of their x coordinates and their y coordinates and then squaring those differences. the squares are added and the square root of the resulting sum is taken and... voila! the distance. given two variables, p1 and p2 that are of type point -- a structured type with two fields, x and y, both of type double-- write an expression whose value is the distance between the two points represented by p1 and p

2 Answers

4 votes

Final answer:

The distance between two points can be found using the formula sqrt((x2 - x1)^2 + (y2 - y1)^2).

Step-by-step explanation:

The distance between two points can be found using the formula sqrt((x2 - x1)^2 + (y2 - y1)^2). To find the distance between the two points represented by p1 and p2, we substitute the x and y coordinates of p1 and p2 into the formula:

distance = sqrt((p2.x - p1.x)^2 + (p2.y - p1.y)^2).

User Rubal
by
7.0k points
3 votes
The formula to find the distance between points
P_(1) and
x_(2) is given as
\sqrt{ ( y_(1)- y_(2)) ^(2)+ ( x_(1)- x_(2)) ^(2) }, where


y_(1)- y_(2) is the vertical distance between two points on the y-axis

x_(1) - x_(2) is the horizontal distance between two points on the x-axis
In mathematics, the distance between one point (a) and another point (b), each with-example-1
User Eae
by
6.5k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.