Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Big Data Interview 751 Comprehensive Questions And Expert Answers

Authors: Mr Bhanu Pratap Mahato

1st Edition

B0CLNT3NVD, 979-8865047216

More Books

Students also viewed these Databases questions

Question

How does the project manager integrate functional areas?

Answered: 1 week ago

Question

=+35-5 Discuss how smart thinkers use intuition.

Answered: 1 week ago