Plotting (complex?) functions



On Mon, 18 Sep 2006, Andrej Vodopivec wrote:
> The way I think of how plot2d works is
> 
> (a - with plot_realpart false): plot functions defined on a subset of
> R with values in R,
> 
> (b - with plot_realpart true): plot realpart(f) instead of f.
> 
> I would expect (a) if I new nothing about plot2d and I think it should
> be the default behaviour. Why do you think (b) is correct and (a) is
> not?
I agree completely. I think the behaviour (a) is what most of us would 
expect (without reading documentation).

The example which started this discussion: the function 
sqrt(x-2)*sqrt(x-4)
What is its value, say, at x=0? According to the (documented!) definition 
of sqrt used by maxima (and by the whole world, too),
sqrt(0-2) = + %i * sqrt(2)
sqrt(0-4) = + %i * 2
result = - 2*sqrt(2)
I see no reasons why this point should not be on the plot.
If it is not drawn, I'd consider this an error.

There was a proposal to add the third behaviour, (c):
don't draw our function in such places in R where some intermediate 
results during the function calculation are not real, even if the final 
result is.

I am *very much* against this (proposed) behaviour, because it makes no 
sense: I can always add +%i and -%i to any expression, and the above rule 
says that nothing should be drawn at all. I proposed a less trivial 
example: real roots of a quartic (or cubic) equation which contain 
non-real intermediate radicals.

Andrey