home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / help / complex.hlp < prev    next >
Encoding:
Text File  |  1988-07-27  |  3.1 KB  |  92 lines

  1. \ Help for Complex Floating Point Arithmetic
  2.  
  3. Note: Complex numbers are stored on the floating point stack with the
  4.         imaginary part on top and the real part second on the stack.
  5.  
  6. ZDROP   ( Z: z -- )
  7.         Drop a complex number from the floating point stack.
  8.  
  9. ZDUP   ( Z: z -- z z )
  10.         Duplicate a complex number on the floating point stack.
  11.  
  12. ZSWAP   ( Z: z1 z2 -- z2 z1 )
  13.         Exchange the top two complex numbers on the floating point stack.
  14.  
  15. ZNIP    ( Z: z1 z2 -- z2 )
  16.         Drop the second complex number from the floating point stack.
  17.  
  18. ZNEGATE   ( Z: z1 -- z2 )
  19.         Negate the complex number on the floating point stack.
  20.  
  21. ZCONJUGATE   ( Z: z1 -- z2 )
  22.         Replace the complex number on the floating point stack with its
  23.         complex conjugate.
  24.  
  25. ZJ*     ( Z: z1 -- z2 )
  26.         Multiply the complex number on the floating point stack by the
  27.         unit imaginary operator j .
  28.  
  29. Z+      ( Z: z1 z2 -- z3 )
  30.         Add the two complex numbers on the floating point stack.
  31.  
  32. Z-      ( Z: z1 z2 -- z3 )
  33.         Subtract the complex number at the top of the floating point
  34.         stack from the complex number second on the floating point
  35.         stack.
  36.  
  37. Z*      ( Z: z1 z2 -- z3 )
  38.         Replace the top two complex numbers on the floating point stack
  39.         with their complex product.
  40.  
  41. Z/      ( Z: z1 z2 -- z3 )
  42.         Complex divide the complex number second on the floating point
  43.         stack by the complex number at the top of the floating point
  44.         stack.
  45.  
  46. ZVARIABLE   ( -- addr )
  47.         Create a variable to hold a complex number.
  48.  
  49. Z!      ( Z: z -- ; addr -- )
  50.         Store the complex number at the top of the floating point stack
  51.         at the address specified at the top of the parameter stack.
  52.  
  53. Z@      ( Z: -- z ; addr -- )
  54.         Push a copy of the complex number at the address specified at the
  55.         top of the parameter stack onto the floating point stack.
  56.  
  57. ZMAG    ( F: r1 r2 -- r3 )
  58.         Replace the top two numbers on the floating point stack with
  59.         the square root of the sum of their squares.  Used to obtain
  60.         the magnitude of a complex number, for example.
  61.  
  62. TOPOLAR   ( F: x y -- r theta )
  63.         Convert the complex number at the top of the floating point
  64.         stack from its cartesian form to polar form.  The angle is
  65.         in radians.
  66.  
  67. TOCART   ( F: r theta -- x y )
  68.         Convert a complex number in polar coordinate form to cartesian
  69.         coordinate form.
  70.  
  71. F^2     ( F: r -- r^2 )
  72.         Square the floating point number on top of the floating point
  73.         stack.
  74.  
  75. F2/     ( F: r -- r/2 )
  76.         Divide the floating point number at the top of the floating
  77.         point stack by 2.
  78.  
  79. F2*     ( F: r -- 2*r )
  80.         Multiply the floating point number by 2.
  81.  
  82. ZSQRT   ( Z: z1 -- z2 )
  83.         Take the complex square root of the complex number at the top
  84.         of the floating point stack.  The root which is returned has
  85.         a positive real part.
  86.  
  87. -ZSQRT   ( Z: z1 -- z2 )
  88.         Take the complex square root of the complex number, and return
  89.         the root which has a negative real part.
  90.  
  91.  
  92.