Question: in c not c++ 3 Coordinate Frames: (40 points) We wish to write a program that calculates the conversions between Cartesian and Spherical Coordinates. Spherical

 in c not c++ 3 Coordinate Frames: (40 points) We wish
to write a program that calculates the conversions between Cartesian and Sphericalin c not c++

3 Coordinate Frames: (40 points) We wish to write a program that calculates the conversions between Cartesian and Spherical Coordinates. Spherical to Cartesian Cartesian to Spherical I= pcos(6) sin(6) y=psin() sin() 2 pcos(o) p=2+ y + z2 0 = tan-'9) Your code must use the following two functions prototypes are void sphere-2-cart (double rho, double theta.deg. double phi.deg, double .x, double *y, double *z void cart.2.sphere (double x, double y. doublez, double erho, double thelader double phl der Your code must ignore nonsensical inputs; for example; those shown in the sample execution Your code must ignore nonsensical inputs; for example; those shown in the sample execution. Sample Code Execution: Red text indicates information entered by the user What coordinate system is the input? (1=Cartesian, 2-Spherical): 5 What coordinate system is the input? (1-Cartesian, 2-Spherical): -2 What coordinate system is the input? (1=Cartesian, 2-Spherical): 1 Enter the Cartesian coordinate values for x,y and z: 0 -3 4 Cartesian Values: x = 0.000000, y = -3.000000, z = 4.000000 Spherical Values: rho - 5.000000, thetr (deg) - -90.000000, phi (deg) - 36.869898 Would you like to keep going (y)? P Would you like to keep going (y)? Q Would you like to keep going (y)? Y What coordinate system is the input? (1-Cartesian, 2-Spherical): 2 Enter the Spherical coordinate values for rho, theta (deg.) and phi (deg.): 10.2 -45 60.1 Cartesian Values: x - 6.252483, y = -6.252483, Z - 5.084575 Spherical Values: rho - 10.200000, theta (deg) - -45.000000, phi (dog) - 60.100000 Would you like to keep going (y)? N Goodbye 4 Lab Assignment: (30 points)

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!