Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

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

Students also viewed these Databases questions