Hello,
1) I want to plot the sign of the square root of some function. One expects to obtain values {1} and {0} in the domain where the expression under the square root is positive or zero respectively. In addition to that, I have several pieces on the plot with values continuously ranging from -1 to 1. What is it and how can one avoid that?
The second question is similar.
2) I want to plot the sign of a quite complicated function. But in addition to domains with values {-1,0,1} I have a contribution with value continuously ranging from -1 to 1. What is it and how can one avoid that?
The notebook is enclosed.
The sign seems to be zero only in a meager set. I would plot directly the value 1 with a RegionFunction:
RegionFunction
Plot3D[1, {x, 0, 2 \[Pi]}, {y, 1, 5}, RegionFunction -> Function[{x, y}, (1 - 2 y Cos[x])/(1 - y Cos[x]) > 0], PlotPoints -> 50]
And the function
Sqrt[((1 - 2 y Cos[x])/(1 - y Cos[x]))
is complex for parts of the range plotted. RealSign does not work for complex numbers.
RealSign
Thank you! I even remember reading about this :)
Thank you a lot! RegionFunction works perfectly for the square root case. In the second case, I added PlotPoints -> 70 and achieved the desired result.