Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Here is the data from the data file called cartesian.txt Thank you so much! i will give thumbs up! ENGR 200 SPRING 2019 A4: COMPUTING
Here is the data from the data file called cartesian.txt
Thank you so much! i will give thumbs up!
ENGR 200 SPRING 2019 A4: COMPUTING CIRCLE PROPERTIES (using input/output files, a control number, a for loop, if structures, and six one-dimensional numeric arrays) DUE: Feb. 25, 2019 at 11:59 pm, CST, (Mon/Wed section) Feb. 26, 2019 at 11:59 pm, CST, (Tues/Thur sections and DEDP) POINTS: 60 INTRODUCTION: One way of computing the center of a circular region is to map three points on the circle. Assume that there are two non-parallel lines connecting th points that are touching the boundary of the circular plane. By geometry we know that the perpendicular bisectors of the two lines will pass through the center of the circle. See the illustration to the right e three P, Using the two line segments PP compute the slope of each line connecting the points. Using that information we can compute the center point of the circle and the radius of the circle. Ps we can The equations to compute the slopes of each line segment defined by the Cartesian coordinates of (x,, Vi). (Xz, V2), and (x2. Va) are The equations to compute the x and y coordinates for the center of the circle are 2(m2-mi The equation to compute the radius of the circle is: Your program must use the square root function and the power An input data file called cartesian contains the input coordinates for numerous line segments. The data file is space delimited. When you examine the input file, the first record line is the control number to be used in the for loop in the program. All record lines after the first line are the x and y coordinates for the points P. P2, and P3 respectively ASSIGNMENT: Write a C program that will read from the input data file the control number, and the x and y coordinates of the three points into six one-dimensional numeric arrays. The program will compute the x coordinate of the center of the circle, the y coordinate of the center of the circle, and the radius of the circle. The program will generate a table that displays the circle identifying number, the P1, P2, and P3 coordinates, the center of the circle coordinates, and its radius. The table output format is shown below. Print the table to the computer screen and to an output file called circle properties The program will check for computational slope errors. Specifically: Ifx2-xl is equal to 0.0 or x3-x2 is equal to 0.0 then print the message "Computation not possible" else compute slope 1, slope 2, circle center, circle radius, and print the table of values as shown below OUTPUT FORMAT: COMPUTED CIRCLE PROPERTIES Circle P1 P2 Center Radius x (xX.xxx.x) (xx.x.xx.x) (xxx.xx.x) (XXx.xXx) xxx Print message The output format that is printed to the computer screen and to the output file will be heavily graded for both vertical and horizontal spacing. Furthermore, the portions of the program that will be examined and graded in much greater detail are . . . . Correct application of the input and output files. Correct use of the six one-dimensional numeric arrays. Reading all the data before computations are performed. Correct use of the for loop. Correct use of if else. FILE PATHS: Before submitting your program to Blackboard, you must set the following file paths in your program: "u:engr 200\cartesian.txt" "u:\\engr 2001\circle_properties.txt" 7 1.0-1.0 1.0 1.0 3.0 -1.0 2.04.49-4.0 0-1.9-4..9 5.0 0.0 3.0 2.0 0.0 0.0 3.0 3.0 0.0 0.0 -3.0 -3.0 0.0 0.1 0.0 e.2 0.0 0.3 1.3 1.2 2.3 3.1 0.4 2.0Step 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