# plot complex function

• Jan 28th 2008, 09:45 AM
linearmath
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.

• Jan 28th 2008, 09:54 AM
ThePerfectHacker
Quote:

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 $\displaystyle w$ as $\displaystyle f(x+iy) = (x+iy) - 2 = (x-2) + i y$. Thus, $\displaystyle \Re (w) = x-2$ and $\displaystyle \Im (w) = y$. And $\displaystyle |w| = \sqrt{(x-2)^2+y^2}$.
• Jan 28th 2008, 10:35 AM
linearmath
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