Question: Write a Matlab function called spher2 cart that will convert Spherical coordinates to Cartesian coordinates. Note that this function will have three inputs and

Write a Matlab function called spher2 cart that will convert Spherical coordinates

 

Write a Matlab function called spher2 cart that will convert Spherical coordinates to Cartesian coordinates. Note that this function will have three inputs and three outputs. Test you function using spherical coordinates: (p, 0, 0) = (2, %, %). For this program, once it works, add the nargin commands to check for correct number of inputs and write appropriate messages. Converting from spherical to Cartesian coordinates z-axis Z S (x, y, z) A F S 8 8 S x (x, y, 0) y-axis x Notice that, by the Pythagorean Theorem x-axis S = = p sin P = S + z = = x + y + z 2 8 = Scos = p sin cos Y = S sin = psin o sin == p cos

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 Programming Questions!