Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c code We wish to write a program that calculates the conversions between Cartesian and Spherical Coordinates. Spherical to Cartesian Cartesian to Spherical =

image text in transcribed

in c code

We wish to write a program that calculates the conversions between Cartesian and Spherical Coordinates. Spherical to Cartesian Cartesian to Spherical = p cos() sin(6) y=psin() sin(6) 2 = p cos(6) p= Vr+ y2 + 22 0 = tan 6 = tan (VP+6) 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 *2); void cart.2.sphere (double x, double y, double z, double #rho, double theta.deg, double *phi_deg); 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, theta (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: -6.252483, y = -6.252483, 2 - 5.084575 Spherical Values: rho - 10.200000, theta (deg) - -45.000000, phi (deg) - 60.100000 Would you like to keep going (y)? N Goodbye

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago