Question: Line segment information This program allows the user to draw a line segment and then displays some graphical and textual informaiton about the line segment.

Line segment information

This program allows the user to draw a line segment and then displays some graphical and textual informaiton about the line segment.

Input: Two mouse clicks for the end points of the line segment. Output: Draw the midpoint of the segment in cyan. Draw the line. Print the length and the slope of the line. Formula: dx = x2-x1

dy = y2-y1

slope = dy/dx

length = ?dx2+dy2

B) Modify your program from part (a) so you have a second program named line2.py. This program will have the midpoint labeled, offset slightly from the actual location of the midpoint of the line

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!