Question: anyone know how to do this in c program The polar coordinates r and of a point (x, y) in the plane can be computed

anyone know how to do this in c program The polar coordinates r and of a point (x, y) in the plane can be computed as follows: r = p x 2 + y 2 = ( acos(x/r) if r > 0 and y > 0 acos(x/r) if r > 0 and y 0 0 if r = 0 Write a program called xy2polar.c which uses a function called polar to compute the polar coordinates of a point. Your program must consist of a main program and a function called polar. The function polar takes the x and y coordinates of a point as arguments and computes the polar coordinates coordinates (r, ). Your program must consist of a main program, which opens the output file polar.txt for appending (mode = a), reads the (x, y) coordinates, from the user, calls polar, and then write both the (x, y) coordinates and the corresponding (r, ) polar coordinates to the output file. For marking purposes run your program 4 times with (x, y) as follows: (2,2), (1,-1), (0,1) and (3,-1). The first (and subsequent) lines of your output should look like: The polar coordinates of (2.000, 2.000) are r = 2.828 and theta = 0.785

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!