Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions