Question: Write a function [ r , theta ] = polar _ coordinates ( x , y ) that outputs polar coordinates r and theta for

Write a function [r,theta]= polar_coordinates(x,y) that outputs polar coordinates r and theta for input coordinates x and y given by two numbers.
IMPORTANT: to make things simple, assume that your x and y are two numbers (NOT vectors). This way you can use if-statements.
Your theta should be in degrees in the range between 0 and 360, i.e.0 theta 360.
HINT: if you are using inverse trigonometric functions, make sure you understand which range of values MATLAB is going to return. MATLAB may not automatically cover the required range of theta.Write a function , theta]= polar_coordinates (x,y) that outputs polar coordinates r and theta for input coordinates x and y given by two numbers.
IMPORTANT: to make things simple, assume that your x and y are two numbers (NOT vectors). This way you can use if-statements.
Your theta should be in degrees in the range between 0 and 360, i.e.0 theta 360.
HINT: if you are using inverse trigonometric functions, make sure you understand which range of values MATLAB is going to return. MATLAB may not automatically cover the
required range of theta.
Function ?
function , theta]= polar_coordinates (x,y)
r=x???2+y???22;
theta =atan2(y,x);
theta theta
 Write a function [r,theta]= polar_coordinates(x,y) that outputs polar coordinates r and

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