Question: Solve using matlab Find a Circle Three points on a circle are given in an input file: The equation of a circle with radius R

Solve using matlab
Find a Circle
Three points on a circle are given in an input file:
The equation of a circle with radius R and center at (x0,y0) is given by:
(x-x0)2+(y-y0)2=R2
The equation can also be written in the form:
-2x0x-2y0y+c=-(x2+y2) where c=x02+y02-R2
Given the coordinates of three points (x1,y1),(x2,y2) and (x3,y3) it is possible to determine the radius
and the coordinates of the center of the circle that passes through the three points. This is done by
substituting the coordinate of each of the points in the equation and solving the system of three linear
equations for x0,y0 and c.
Write a script which can read an input file in the format shown above. Prompt for the input filename.
Calculate the center and radius. Then the write the original coordinates of the three points, the center
and radius into an output file having this format:
The original points are shown in columns in the output file first, followed by the center, followed by the
radius. All numbers are printed in a field of 15 character with 4 digits after the decimal. There is one
space between the x and y fields for the data and for the center. The center and radius have the strings
"center" and "radius" printed after the numbers, separated from the numbers by one spaced, as shown.
Be sure to prompt for the output filename.
x y
11.55
3.28.6
-4.5-6
 Solve using matlab Find a Circle Three points on a circle

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!