Question: PYTHON ONLY Write a program that outputs the equation of the perpendicular bisector of the line segment between two points. Your program should - prompt

PYTHON ONLYPYTHON ONLY Write a program that outputs the equation of the perpendicularbisector of the line segment between two points. Your program should -

Write a program that outputs the equation of the perpendicular bisector of the line segment between two points. Your program should - prompt for and input the coordinates of two points [for example (2.0, -4.0) and (7.0,2.0) ]; - compute the slope of the line between those two points; - compute the coordinates of the midpoint of the line segment between the two points by averaging the two x coordinates and the two y coordinates; - compute the slope of the perpendicular bisector by taking the neative reciorocal of the slone of the line segment; - compute the y intercept of the perpendicular bisector (you now have the slope m of the bisector and a point ( xmid , ymid ) on the bisector, so the y intercept is ymid - mxxmid); and - output the midpoint coordinates and the equation of the bisector as shown below. The figure above illustrates the sample line segment mentioned above and its perpendicular bisector. Note: You need to consider the special cases where the perpendicular bisector is vertical or horizontal as shown in the sample runs 2 and 3. Sample run 1 Enter x coordinate of point 1:2 Enter y coordinate of point 1:4 Enter x coordinate of point2: 7 Enter y coordinate of point2: 2 midpoint coordinates (4.50,3.00) Bisector equation: y=2.5x+8.25 Sample run 2 Enter x coordinate of point 1:2.5 Enter y coordinate of point 1:10.5 Enter x coordinate of point 2:14.8 Enter y coordinate of point2: 10.5 midpoint coordinates (8.65,10.50) Bisector line is vertical with equation: x=8.65 Sample run 3 Enter x coordinate of point1: 7.5 Enter y coordinate of point 1:3.8 Enter x coordinate of point 2:7.5 Enter y coordinate of point2: 20.5 midpoint coordinates (7.50,12.15) Bisector line is horizontal with equation: y=12.15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!