% Get two numbers from the stack and make % a complex number out of them. % By L.Linares 2006 % Usage: Put two numbers on the stack % 2: a % 1: b % This programs behaviour depends on the % (Polar/Rectangular) mode active. If it's % in Rect mode, the program will acquire the % two numbers in levels 2 and 1 of the stack % and create the complex (a,b). If the calculator % is in Polar mode, the program acquires the % two numbers in levels 2 and 1 of the stack % and creates the complex with absolute value % 'a' and angle 'b' (deg or rad depending on % the angle mode active. << -16 FS? -> X << IF 'X==0' THEN R->C ELSE -> A B << A B COS * ->NUM A B SIN * ->NUM R->C >> END >> >> ----------------------------------------------- % This is the complement of the program above. % It breaks a complex number in two real numbers % and puts them on the stack. It depends on the % REC/POL mode active. << -16 FS? -> X << IF 'X==0' THEN C->R ELSE DUP ABS SWAP ARG END >> >>