Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function call it slope_distance (its name) that accepts the coordinates of 2 points, and returns the slope of the line connecting the 2
Write a function call it "slope_distance" (its name) that accepts the coordinates of 2 points,
and returns the slope of the line connecting the 2 points, also returns the distance between the 2 points.
call this function from the main function, and let the program prints the returned values from the function "slope_distance" in the main.
slope=(y2-y1)/(x2-x1)
distance=sqrt(x2-x1)*(x2-x1)+(y2-y10*(y2-y1))
p1(x1,y1) first point
p2(x2,y2) second point
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started