Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program (Functions and Plots): File: polar.txt Numbers: 55 3.9269875 47 0.7853975 0 0 1 0.25 2 0.5 3 0.75 4 1 5

Write a C program (Functions and Plots):

image text in transcribed

File: polar.txt

Numbers:

55 3.9269875 47 0.7853975 0 0 1 0.25 2 0.5 3 0.75 4 1 5 1.25 6 1.5 7 1.75 8 2 9 2.25 10 2.5 11 2.75 12 3 13 3.25 14 3.5 15 3.75 16 4 17 4.25 18 4.5 19 4.75 20 5 21 5.25 22 5.5 23 5.75 24 6 25 6.25 26 6.5 27 6.75 28 7 29 7.25 30 7.5 31 7.75 32 8 33 8.25 34 8.5 35 8.75 36 9 37 9.25 38 9.5 39 9.75 40 10 
The file "polar.txt" contains a series of 2D polar coordinates, r and theta. The first coordinate, when converted to Cartesian coordinates, gives the lower left extreme of the data set, and the second, when converted to Cartesian coordinates, gives the upper right extreme of the data set. Use these first two points to set the scale of your plot. Subsequent points define the data set. Remember that to convert from polar to Cartesian coordinates, use xr cos(theta) y -r sin(theta) Write a program that prompts the user for the name of a data file whose format is the same as that in polar.txt and places a cross at each data point. You will be using functions defined in the plotFunction project for the graphics. Your program should implement functions to convert r and theta to x and y. A sample data set is included, but your program should work for any data set that has the data as described above. Once again, read until the end-of-file is detected Supporting Materials polar.txt

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

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

Evaluate the integrals in Problems 5762. S x x 1 -dx 2x + 3

Answered: 1 week ago