POLAR COMPLEX NUMBERS PROGRAM FOR CASIO fx-9700 CALCULATORS (it probably works on others, but I haven't tried it.) By Daniel Wedge *** MORE GAMES AND PROGRAMS FOR CASIO CALCULATORS AT *** ******** http://www.student.uwa.edu.au/~wedgey ********* This program will convert complex numbers from one form to another (polar and cartesian/rectangular), will apply De Moivre's theorem to polar complex numbers and will also provide basic functions (addition, subtraction, multiplication, division) for polar complex numbers which the calculator won't do automatically. (You can do all of the things mentioned above for cartesian complex numbers without this program - that's why the program won't do it for you!) SIZE:760 bytes SYMBOLS USED: != not equal to < less than > greater than <= less than or equal >= greater than or equal => and / then (Prog/Jump/F1) @ display % fraction (the a b c button) / divide pi the pi symbol sqrt the square root sign THE CODE: 'POLAR Rad Real men use radians - you don't have to 0 -> A~Z but the exact angle code won't work Lbl 0 "1.CART->POL" use the assign key here for -> "2.POL->CART" "3.DE MOIVRES" "4.ADD 5.SUB" "6.MULT 7.DIV"?->X X=Int X => X<=7 => X>1 => Goto A X=1 => Goto M Goto 0 Lbl A "MOD 1"? -> A Modulus (r) of first polar number A<=0 => Goto A "ARG 1"? -> B Argument (angle) - use pi rather than 3.14... X=2 => Goto C otherwise the exact angle detect won't work X=3 => Goto D Lbl B "MOD 2"? -> C C<=0 => Goto B "ARG 2"? -> D X=4 => Goto G X=5 => Goto H X=6 => Goto I X=7 => Goto J Lbl C "REAL:":Acos B@ "IMAG:":Asin B@ Goto Z Lbl D "POWER"? -> E power is n in (r cis T)^n A^E -> F T is theta - couldn't find a theta! BE -> G Goto V Lbl G Acos B+Ccos D -> H Asin B+Csin D -> I Goto P Lbl H Acos B-Ccos D -> H Asin B-Csin D -> I Goto P Lbl I AC -> F B+D -> G Goto V Lbl J A/C -> F B-D -> G Goto V Lbl M "REAL"? -> H "IMAG"? -> I H=0 => I=0 => Goto M Goto P Lbl P H+Ii -> N i is the imaginary part - F1 in complex menu Abs N -> F Arg N -> G Goto V Lbl V F/sqrt2=Int (F/sqrt2) => 1 -> K sqrt=square root sign 2F/sqrt2=Int (2F/sqrt2) => 2 -> K F/sqrt3=Int (F/sqrt3) => 1 -> L 3F/sqrt3=Int (3F/sqrt3) => 3 -> L K!=0 => Goto S L!=0 => Goto T "MOD:":F@ Goto X Lbl S "MOD (LOTS OF sqrt2):" (KF/sqrt2)%K@ Goto X Lbl T "MOD (LOTS OF sqrt3):" (LF/sqrt3)%L@ Goto X Lbl X G<-pi => G+2pi -> G G>pi => G-2pi -> G G<-pi => Goto X G>pi => Goto X G/pi=Int (G/pi) => 1->J 4G/pi=Int (4G/pi) => 4->J 6G/pi=Int (6G/pi) => 6->J J!=0 => G!=0 => Goto Y "ARG:":G@ Goto Z Lbl Y "ARG (LOTS OF pi):" (JG/pi)%J@ Lbl Z "FINISHED"