Question: MATLAB PLS! Only logical, relational, and arithmetic operators pls 4. (Cartesian and Polar Coordinates) Cartesian (also called rectangular) and polar coor- dinates are two different
MATLAB PLS! Only logical, relational, and arithmetic operators pls
4. (Cartesian and Polar Coordinates) Cartesian (also called rectangular) and polar coor- dinates are two different systems for identifying points in the plane. Here we will write two utility functions for translating between them. The formulas for converting from polar to Cartesian are x = r cos 0, y=r sin , while the formulas for converting from Cartesian to polar are T = x2 + y2, 0= arctan if (x,y) is in the first or fourth quadrant, T + arctan, otherwise. Be sure to produce two separate files for this question, namely one for each function. . cartesian_to_polar Function: Input parameters: one scalar representing 2 one scalar representing y Output parameters: one scalar representing r one scalar representing polar_to_cartesian Function: Input parameters: one scalar representing r one scalar representing a Output parameters: one scalar representing 2 one scalar representing y . . Possible sample cases are: >> [r, theta] = cartesian_to_polar(3, 4) r = 5 theta = 0.92730 >> (x, y] = polar_to_cartesian(1, pi/2) X = 6.1232e-17 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
