Re(z) Im(z) Mod(z) Arg(z) Conj(z)
NA
s) are allowed.
Re
),
imaginary parts (
Im
),
moduli (
Mod
),
arguments (
Arg
)
or complex conjugates (
Conj
)
of
z
.
The value of
Arg
satisfies --pi < Arg(z) <= pi.
All of these return objects of mode
"numeric"
except
Conj
which returns a complex object.
Missing values in the input create missing values in the output.
rpart <- seq(-.5, 1, length=100); ipart <- seq(-1, 1, length=100) cmat <- outer(rpart, ipart*1i, "+") # matrix of complex numbers # first set up a blank coordinate system for the plot plot(0:1, 0:1, type="n", axes=F, xlab="", ylab="") # now make subplots within that region sp <- subplot(x=c(0, .85), y=c(0, 1), image(rpart, ipart, tan.M <- Mod(tan(cmat)), xlab="Real part", ylab="Imaginary part", main="Tangent Function")) # make two additions to this plot subplot(pars=sp, contour(add=T, rpart, ipart, Arg(tan(cmat)), v=-2:3, labex=0)) subplot(pars=sp, text(c(-.2, .25, .45, .4, -.25), c(-.5, -.4, -.03, .55, .5), -2:2)) # add legend and title image.legend(tan.M, x=c(.92, 1), y=c(.25, .75), horiz=F) title(sub="Shades for Modulus, Lines for Argument")