Define a C structure complx for a complex number with two data members for the (real, imaginary) real and imaginary parts of the complex number. It should be able to handle any real numbers! Use typedef to make your program readable.
. Define a C structure complx for a complex number with two data
members for the (real, imaginary) real and imaginary parts of the
complex number. It should be able to handle any real numbers! Use
typedef to make your program readable.
2. What we want to do next is to write a procedure to raise any complex
number to any integer power
(? + ??)?
Where ? and ? are real number and ? is an integer!
3. What we want to do next is write (? + ??)?? ????
where ? = √(?2 + ?2 ) ??? tan−1(?) = (? ?)
4. Then we can write (? + ??)? ?? ?????? and go back to write the result
as ?????? ?? (???? ?(??) + ??? ???(??))
5. In your procedure (function) you will use for-loop to compute the value
of ??. If you remember, we wrote very efficient programs to compute
the ???(?) ??? ???(?) functions. You may use those or include the
math library header file and use the trig functions
[???( ) , ???( ) ??? ???( )]
and the square-root functions only!
6. Note that the ???(?) is multi-valued. So you should check to see that
you are in the right quadrant!
7. The function should print the result on the screen in the form
Ans: ( x, jy) which should also be the value returned by the function to
main()
Step by step
Solved in 3 steps with 1 images