Answers
![Hasan Alrajhi](https://data3.answerbase.com/answerbase/2948/UserFiles/User843380/profileImage843380.jpg?635345143950000000)
Jun 21, 2018 - 09:55 AM
Hi there
As I know you should split your complex number into two parts and then deal with them separately.
Regards
Hasan
As I know you should split your complex number into two parts and then deal with them separately.
Regards
Hasan
![patrickrossiter](https://data3.answerbase.com/answerbase/2948/Images/Avatars/avatar_01.jpg)
Apr 01, 2019 - 05:22 PM
Hi there,
I think you need to declare all variables on their own line as shown below. However I found that this gives you an incorrect result. Can't help you more than that but hopefully this progresses you a little.
#LOCAL COMPLEX X1 #LOCAL COMPLEX Y1 #LOCAL COMPLEX S1 #LOCAL REAL A1 #LOCAL REAL B1 #LOCAL REAL C1 #LOCAL REAL D1 A1=1.0 B1=0.0 C1=1.0 D1=0.866 X1=CMPLX(A1,B1) Y1=CMPLX(C1,D1) S1=X1/Y1 $i1 = REAL(S1)
$i2 = IMAG(S1)
I think you need to declare all variables on their own line as shown below. However I found that this gives you an incorrect result. Can't help you more than that but hopefully this progresses you a little.
#LOCAL COMPLEX X1 #LOCAL COMPLEX Y1 #LOCAL COMPLEX S1 #LOCAL REAL A1 #LOCAL REAL B1 #LOCAL REAL C1 #LOCAL REAL D1 A1=1.0 B1=0.0 C1=1.0 D1=0.866 X1=CMPLX(A1,B1) Y1=CMPLX(C1,D1) S1=X1/Y1 $i1 = REAL(S1)
$i2 = IMAG(S1)
Add New Comment![Sending...](https://forum.hvdc.ca/images/loading-boxes.gif)