answersLogoWhite

0


Best Answer

complex to-complex(mag, theta)

{

if(mag >=0)

{

real = mag * cos(theta);

img = mag * sin(theta);

return real + i * img;

}

else

raise error;

}

One test is needed : mag must be a positive number!

And the return value is depending of your way to deal with complex number

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a function to-complex that accepts two input arguments containing the magnitude mag and angle theta of the complex number in degrees and returns the complex number c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

How do you write a function with a variable number of input elements in PHP?

When defining your function, do not put any arguments in the definition (e.g. function myFuntion()). Inside the function, you can use func_num_args() and func_get_arg($number) to get the function's arguments.


What is a basic structure of a c programming?

Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...) Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...)


What is function parameters?

whatever the variables we declare in function signature to receive the arguments at the calling that are known as parameters.. e.g. int sum(int a,int b); here a & b are known as parameters.....


What do you use to separate multiple arguments that are passes to a function?

Commas. The call looks like: $returnValue = ourCrazyFunction($arg1, $arg2, $arg3);


What is the difference between function and recursive function?

I will explain in the easiest way the difference between the function and recursive function in C language. Simple Answer is argument of the function is differ but in the recursive function it is same:) Explanation: Function int function(int,int)// function declaration main() { int n; ...... ...... n=function(a,b); } int function(int c,int d) { ...... ...... ...... } recursive Function: int recursive(int,int)// recursive Function declaration main() { int n; ..... ..... ..... ..... n=recursive(a,b); } int recursive(int a,int b) { ..... .... .... .... } Carefully see, In the recursive Function the function arguments are same.

Related questions

What are the formal arguments?

Formal arguments are the named arguments defined by the function. Actual arguments are those arguments that were passed to the function by the caller.


What is meant by arguments in c?

Arguments appear in functions and in function calls. Arguments passed to a function are known as actual arguments. The arguments used by the function are known as the formal arguments. In C, all arguments are passed by value, such that the formal argument is a copy of the actual argument.


How many arguments can the average function have?

The AVERAGE function has up to 255 arguments in Excel.


What is a minimum function?

The minimum function is the function that takes two arguments and returns the smallest of the two. Alternatively the function can take any finite amount of arguments and return the smallest.


What is a built-in formula that uses arguments to calculate information?

an is a built in formula that uses arguments to calculate information. is FUNCTION


Is it possible for a function to have no arguments?

Of course.


Where do you find a list of Excel arguments?

Each function in Excel that has arguments will differ in terms of what arguments are needed. The help for a particular function will indicate what arguments may be needed. Some functions can be used in different ways and may not always need all arguments.


How do you write a function with a variable number of input elements in PHP?

When defining your function, do not put any arguments in the definition (e.g. function myFuntion()). Inside the function, you can use func_num_args() and func_get_arg($number) to get the function's arguments.


Does The PMT function have 4 arguments in Excel?

No, it has five arguments. Two of them are optional.The syntax for the PMT function is:PMT(interest_rate, number_payments, PV, FV, Type)The FV and Type arguments are optional.


When does the function arguments box appear in Excel?

It shows you what needs to be put into a function for it to work. You can type the arguments directly into the boxes that are shown for the particular function you are using. It is particularly handy for more complex functions that you are not used to working with.


Can you use arguments in main function?

Yes.


Values used with a function in Excel?

Arguments