# Math Help - plot complex function

1. ## plot complex function

i have a problem that said using computer program. to plot complex number

w(z)=z-2
- plot function as real and imaginary parts, ie... plot real part of w as a function of z = x+iy on [x,y] plane and plot the imaginary part in the same way.

-plot the magnitude and phase of w(z) as a function of z=x+iy on the [x,y] plane.

2. Originally Posted by linearmath
i have a problem that said using computer program. to plot complex number

w(z)=z-2
- plot function as real and imaginary parts, ie... plot real part of w as a function of z = x+iy on [x,y] plane and plot the imaginary part in the same way.

-plot the magnitude and phase of w(z) as a function of z=x+iy on the [x,y] plane.

You can think of $w$ as $f(x+iy) = (x+iy) - 2 = (x-2) + i y$. Thus, $\Re (w) = x-2$ and $\Im (w) = y$. And $|w| = \sqrt{(x-2)^2+y^2}$.

3. as you said,

which is the magnitude of |w(z)|=sqrt(x^2 + y^2) - 2 and the phase = tan-1(Im/Re)

as i use mathcad and set it up like below,

give x = -5,-4.9..5
y = -5,-4.9..5

z:= x+iy

w(z):=z-2

and I couln't get plot for the imaginary part, the phase and the magnitude

because of undefined variable i.

if you have any recommendation of other software, thanks a lot