In this question I want to specify a domain of $0<=x<=1$ and $0<=y<=1$ in the Z Math Surface (object menu Add > Math Function > Z Math Surface) for the equation. I also need it to exclude the imaginary result.
(y-x+1-((y-x+1)**2 -4*y if 4*y < (y-x+1)**2 else 0 )**(1/2) ) / 2
I tried ((y-x+1-((y-x+1)**2 -4*y if 4*y < (y-x+1)**2 else 0 )**(1/2) ) / (2)) if x >= 0 and x <= 1 and y >= 0 and y <= 1 else 0
And also tried (((y if y >= 0 and y <= 1 else 0)-(x if x >= 0 and x <= 1 else 0)+1-(((y if y >= 0 and y <= 1 else 0)-(x if x >= 0 and x <= 1 else 0)+1)**2 -4*(y if y >= 0 and y <= 1 else 0) if 4*(y if y >= 0 and y <= 1 else 0) < ((y if y >= 0 and y <= 1 else 0)-(x if x >= 0 and x <= 1 else 0)+1)**2 else 0 )**(1/2) ) / (2))
But nothing can get me the correct result as when I plot it with python which should look like this:
How do I tell Z Math Surface to use a range of values within $0<=x<=1$ and $0<=y<=1$ that automatically exclude the imaginary results? Is that even possible? It probably is not possible with the math surface functions? Perhaps possible with geometry nodes?
EDIT: Also tried XYZ Math Surface which will still necessitate an if/else statement to exclude the imaginary part and will also give a squarish result:
(v-u+1-((v-u+1)**2 -4*v if 4*v < (v-u+1)**2 else 0 )**(1/2)) / 2
If there is a Geometry Nodes solution please feel free to post it.