Problem 4 - GGiven two points A(-4, –5) and B(4, 1) in XY coordinate system. 4a. Write Python code to calculate the distance between points A and B.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section3.3: Using Mathematical Library Functions
Problem 5E: (General math) Write, compile, and run a C++ program to calculate the distance between two points...
icon
Related questions
Question
Problem 4 -
GGiven two points A(-4, –5) and B(4, 1) in XY coordinate system.
4a. Write Python code to calculate the distance between points A and B.
4b. Suppose that the line equation passing through points A and B is y = mx + b, where m is the slope and b is the y-intercept. Write the code to find the
slope and the y-intercept of the line.
4c. Write a code to plot the graph of the line equation y = mx + b from part (4b) on the interval -4 < x < 4. Provide appropiate labels for both axes.
Transcribed Image Text:Problem 4 - GGiven two points A(-4, –5) and B(4, 1) in XY coordinate system. 4a. Write Python code to calculate the distance between points A and B. 4b. Suppose that the line equation passing through points A and B is y = mx + b, where m is the slope and b is the y-intercept. Write the code to find the slope and the y-intercept of the line. 4c. Write a code to plot the graph of the line equation y = mx + b from part (4b) on the interval -4 < x < 4. Provide appropiate labels for both axes.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr