Contents Links Search
 

RPN Scripts

RPN Documentation

Submit Script

Conversion
   Conversions
   Convert
   Euro
   Euro_Calculator
   Soundex
Engineering
   Feet_&_Inch
   Units
   Water
Entertainment
   Master_Mind
   Sticks!
Finance
   Annuity
   Euro_Calculator
   TVM_Financial_Functions
Math
   3D_Vectors_v1.2
   Base
   Base_Conversions
   Complex_Arithmetic
   Complex_Math
   Discrete_Math
   EBBases
   Fractions
   Fractions
   Least
   Logs_&_Powers
   Misc
   Regressions
   Scientific
   Scientific_Functions
   Scientific_Programmable
   Simple_Complex_Math
   Standard_Normal_Distribution
   Trig
Misc
   Health
   Husband's_Calculator
Physics
   Angle_of_View
   Depth_of_Field
   Physics_Functions
Time
   Clock
   Julian
   Multiple_Timer
   Stop5Watch
   Stopwatch
   Timer
Utility
   Board_Foot_Calculator
   Calendar_Functions
   Checkbook_II
   MiniG
   Stack_Handling_and_Saving
   WindChill

Complex Math
Charles Perry - email


summary
Math functions for complex numbers (including conjugate and
inverse).

instructions
Includes math functions for complex numbers (x+jy).
Assumes x is in stack position 1 and y is in stack
position 2. For two complex numbers, x1 in position 3,
y1 in position 4, x2 in position 1 and y2 in position 2.
Includes inverse of complex number (inv z = 1/z), conjugate
( conj (x+jy) = (x-jy)) swap for swapping x2 y2 with x1 y1.
Also includes polar and rectangular conversion. Assumes angle
is in position 2 and magnitude in position 1. The polar/rectangular
conversion correctly handles cases where angles are 0, 90,
180, 270, and 360. Polar conversion gives all positive angles
(300 instead of -60 for example). CLRx clears both position
1 and 2 (x and y). All functions, with the exception
of polar/rectangular conversion, assume number is in rectangular form.

code
RPN.1
"Complex"
~
"+" r4r3+r3r3+;
"-" r4r3-r3r3-;
"x" g4g2*g4g4*+r4r3*r4r4*-;
"÷"g2g1*g2g1*+g2g6*g5g5*-g2/r5r4*r5r5*+r3/;
~
">R"g2ob#'1E-14'>(g2ib#'1E-14'>(g2ig2*r3or3*:g20>(r2d1#'0'r2n:r2d1#'0'r2)):r2i*#'0');

">P"g1b0>(g2b0>(g10>(g20>(g2g2/Ar3g1*r3g1*+s:g2g2/A#'360'+r3g1*r3g1*+s):g2g2/A#'180'+r3g1*r3g1*+s):g10>(r2d1#'0'r2:r2d1#'180'r2b)):d1g10>(#'90'r2:g10<(#'270'r2b:#'0'r2)));

"CLRx" d1d1;
~
"INV"g2g1*g2g1*+r3ng2/r3r3/;
"CONJ"r2nr2;
"SWP"r4r4;

top
Nth Lab
©1996 - 2001 all rights reserved
August 03, 2001
contact