immutable class CPX < $IS_EQ, $STR, $FMT |
---|
$FMT | $STR | $IS_EQ |
attr re,im:T; |
---|
**** | Real and imaginary parts. |
attr re,im:T; |
---|
**** | Real and imaginary parts. |
attr re,im:T; |
---|
**** | Real and imaginary parts. |
attr re,im:T; |
---|
**** | Real and imaginary parts. |
abs:T |
---|
**** | The absolute magnitude of self. From Numerical Recipes in C, 2nd ed. p. 949. |
abs_squared:T |
---|
**** | The square of the absolute magnitude of self. |
acos:SAME |
---|
**** | -i log(z + sqrt(1-z^2)) better to use: (pi/2)-asin(z) Steele p. 305.*** |
acosh:SAME |
---|
**** | log(z+(z+1)sqrt((z-1)/(z+1))) Steele p. 308*** |
asin:SAME |
---|
**** | -i log(iz + sqrt(1-z^2)) Steele p. 305.*** |
asinh:SAME |
---|
**** | log(z+sqrt(1+z^2)) Steele p. 308*** |
atan:SAME |
---|
**** | (log(1+i*y)-log(1-i*y))/(2*i) Steele p. 307.*** |
atanh:SAME |
---|
**** | log((1+z)sqrt(1/(1-z^2))) Steele p. 308*** |
cis(f:T):SAME |
---|
**** | Ignores self, e^i*f=cos f + i sin f . Steele p. 304. |
conjugate:SAME |
---|
**** | The complex conjugate of self. |
cos:SAME |
---|
cosh:SAME |
---|
**** | (e^z+e^(-z))/2 Steele p. 308*** |
create(c:CPX):SAME |
---|
create(c:CPXD):SAME |
---|
create(x:T):SAME |
---|
create(re,im:T):SAME |
---|
**** | A complex number with real part `re' and imaginary part `im'. |
create_from_polar(mag,phase:T):SAME |
---|
**** | A complex number with magnitude `mag' and phase `phase'. |
cube:SAME |
---|
**** | Self cubed |
cube_root:SAME |
---|
**** | The cube root of self. preliminary, but working. |
div(c:SAME):SAME |
---|
**** | The ratio of self and `c'. From Numerical Recipes in C, 2nd ed. p. 949. |
div(f:T):SAME |
---|
**** | Self div the floating point f. |
exp:SAME |
---|
**** | The complex exponential `e^self'. |
fmt( f: STR ): STR |
---|
is_eq(c: SAME): BOOL |
---|
is_eq(arg: $OB): BOOL |
---|
is_neq(c: SAME): BOOL |
---|
is_nil:BOOL |
---|
is_within(r:T,c:SAME):BOOL |
---|
**** | self is within a circle around c with radius r |
log:SAME |
---|
**** | The complex logarithm. The chosen branch is `log |z| + i phase(z)'. Same convention as Steele, p. 302. |
magnitude:T |
---|
**** | The absolute magnitude of self. |
magnitude_squared:T |
---|
**** | The square of the absolute magnitude of self. |
minus(c:SAME):SAME |
---|
**** | The difference of self and `c'. |
negate:SAME |
---|
**** | The additive inverse of self. |
nil:SAME |
---|
phase:T |
---|
**** | The angle part of the polar represenation of self. `-pi < res <= pi'. Also get "-pi" from a negative real part and a "-0.0" imaginary part. They say 0+0i should be +0, 0-0i should be -0, -0+0i should be +pi, and -0-0i should be -pi. Same convention as Steele, p. 303. |
plus(c:SAME):SAME |
---|
**** | The sum of self and `c'. |
pow(c:SAME):SAME |
---|
**** | self^c = exp(c*log(self)) |
reciprocal:SAME |
---|
**** | The multiplicative inverse of self. |
sign:SAME |
---|
**** | If not zero, a number with same phase as self but unit magnitude. If it is, then returns self. Steele, p. 304*** |
sin:SAME |
---|
sinh:SAME |
---|
**** | (e^z-e^(-z))/2 Steele p. 308*** |
sqrt:SAME |
---|
**** | The square root of self. From Numerical Recipes in C, 2nd ed. p. 949. Steele, p. 302 chooses the branch cut by `e^((log z)/2)' |
square:SAME |
---|
**** | Self squared |
str:STR |
---|
**** | A string representation of self of the form "1.02+3.23i". |
tan:SAME |
---|
tanh:SAME |
---|
**** | (e^z-e^(-z))/(e^z+e^(-z)) Steele p. 308*** |
times(c:SAME):SAME |
---|
**** | The product of self and `c'. |
times(f:T):SAME |
---|
**** | Self times the floating point c. |