03-23-2015, 08:07 PM
The polar_coordinates command changes a complex number
to polar form. For example
polar_coordinates(1+1*i) produces the number [1.414 45].
However, further manipulation on this number is not treated
as a complex number. For example
(0.5+0.5*i)*polar_coordinates(1+1*i) results in
[0.707+0.707*i 22.5+22.5*i]
What is happening is that the program is multiplying the 1.414 by
(0.5+0.5*i) and the 45 by (0.5+0.5*i). Hence, it is treating
the polar_coordinates result as a matrix entry of two numbers.
You would expect the correct answer to be 0+1*i or simply i. That is
(0.5+0.5*i)*(1+1*i)=0+1*i.
The same thing happens if you enter (0.5+0.5*i) in polar form and
multiply this number by a polar_coordinates result.
It also happens when you use the rectangular_coordinates command.
I have found that in a program the best way to change to polar coordinates is to multiply a complex number by 1⌊0. For example
(1⌊0)*(1+1*i) results in 1.414⌊45.
Then,
(1.414⌊45)*(0.5+0.5*i) produces 1⌊90 (in polar form).
and
(0.5+0.5*i)*(1.414⌊45) produces 1*i (in rectangular form).
Comments are welcome.
to polar form. For example
polar_coordinates(1+1*i) produces the number [1.414 45].
However, further manipulation on this number is not treated
as a complex number. For example
(0.5+0.5*i)*polar_coordinates(1+1*i) results in
[0.707+0.707*i 22.5+22.5*i]
What is happening is that the program is multiplying the 1.414 by
(0.5+0.5*i) and the 45 by (0.5+0.5*i). Hence, it is treating
the polar_coordinates result as a matrix entry of two numbers.
You would expect the correct answer to be 0+1*i or simply i. That is
(0.5+0.5*i)*(1+1*i)=0+1*i.
The same thing happens if you enter (0.5+0.5*i) in polar form and
multiply this number by a polar_coordinates result.
It also happens when you use the rectangular_coordinates command.
I have found that in a program the best way to change to polar coordinates is to multiply a complex number by 1⌊0. For example
(1⌊0)*(1+1*i) results in 1.414⌊45.
Then,
(1.414⌊45)*(0.5+0.5*i) produces 1⌊90 (in polar form).
and
(0.5+0.5*i)*(1.414⌊45) produces 1*i (in rectangular form).
Comments are welcome.