Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Challenging C programming practice problem. A line segment can be described by two end-points. Read two line segments as (x_1, y_1) (x_2, y_2) (x_3, y_3)
Challenging C programming practice problem.
A line segment can be described by two end-points. Read two line segments as (x_1, y_1) (x_2, y_2) (x_3, y_3) and (x_4, y_4). You will write a program (1) to draw two lines (2) to draw a small circle at the cross-point if they if they cross to each other as shown below: Refer the wikipedia at https: // en.wikipedia.org/wiki/Line-line intersection for mathematical background. The article gives a formula to find the intersection point of two infinitely long lines defined by the points. This lab asks to find a cross-point of two line segments between the points. Remember that you must test your program with various test cases to show all exceptional cases. Challenge: Read an input file in which each line contains 8 numbers indicating a pair of line segments. Find a cross-point for each pair and draw them in different color, line style and/or thickness. In that way, multiple pairs line segments and circles can be distinguished even they are drawn in a single paperStep 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