Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started