Some graphics with plot and plotfunc

Messages in english

Modérateur : xcasadmin

GermanXG
Messages : 4
Inscription : mar. déc. 24, 2024 6:24 am

Some graphics with plot and plotfunc

Message par GermanXG » lun. mars 24, 2025 4:55 am

Trying to draw a half sphere I came across an unexpected graphic with the following command:

plotfunc(sqrt(9-x**2-y**2),[x,y])

I can plot a half-sphere with plotparam() command, but the graph from the previous command isn't what I expected. Is this a bug?

Another question is with the following command:

plot(x**(1/3),x=-5..5)

Only the first quadrant is graphed. Is this the expected result? Or is it a bug?

Thanks in advance.

parisse
Messages : 5879
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Some graphics with plot and plotfunc

Message par parisse » lun. mars 24, 2025 7:27 am

There is indeed something strange with the 2d plot, the imaginary part should be in another color, like for
plotfunc(i*sqrt(9-x**2-y**2),[x=-4..4,y=-4..4])
plotfunc does "4-d" plots, that is a 3-d plot of the modulus, with a color depending on the argument.
I will have a look.

For x^(1/3) this is expected, because for negative x, x^(1/3) is a complex number. Try plot(surd(x,3)) instead.

GermanXG
Messages : 4
Inscription : mar. déc. 24, 2024 6:24 am

Re: Some graphics with plot and plotfunc

Message par GermanXG » mar. mars 25, 2025 5:40 pm

I see the different color in the graph. And it occurred to me for a moment that this was the imaginary part, but the help doesn't say anything about this (at least the Spanish help).

For plot(x**(1/3),x) I imagined that xcas took 3 as a real number, but I couldn't find a way to tell it to take it as an integer. plot(surd(x,3)) works, thanks.

Regards.

Répondre