145k views
3 votes
You will create a program that will take in the values for two points (x1,x2)and (y1,y2)

find the slope of a line that contains those two points. You can test your program by entering the following two point values:(x1,y1)->(32,22) and (x2,y2)->(53,36).slope should be 2/3.

User Sbg
by
8.7k points

1 Answer

4 votes

Final answer:

To calculate the slope of a line between two points (x1, y1) and (x2, y2), find the 'rise' over 'run'. For points (32, 22) and (53, 36), the slope is 2/3, indicating a 2-unit vertical change for every 3 units of horizontal change.

Step-by-step explanation:

Calculating the Slope of a Line Between Two Points

To calculate the slope of a line that passes through two given points (x1, y1) and (x2, y2), you need to find the difference in the y-values, known as the 'rise', and the difference in the x-values, known as the 'run'. The formula used to find the slope (m) is:

m = (y2 - y1) / (x2 - x1)

For the provided points (32, 22) and (53, 36), the slope would be calculated as follows:

m = (36 - 22) / (53 - 32)
= 14 / 21
= 2/3

Hence, the slope of the line that contains the points (32, 22) and (53, 36) is 2/3, which means that for every 3 units of horizontal change (run), there is a 2-unit vertical change (rise).

User KhawarPK
by
8.0k points