# How do I render the implicit function z^2 + (x-y-1)(z) + y = 0 in Blender?

Is it possible to render the following equation in Blender to make a 3d visual?

$$z^2 + (x-y-1)(z) + y = 0$$

• I sincerely hope you don't have a hundred more equations you want to render and ask a question for each of them :D Aug 12, 2022 at 12:05
• yeah. he should have gotten the idea hopefully or maybe he wants to troll us XD Aug 12, 2022 at 12:09
• Yeah no it's because I'm new to blender and I wanted to use the software to create a visual for a project. I tried plotting the explicit function and it worked but I wanted to create a visual of better quality, and so I thought an implicit equation may be better.
– Arsh
Aug 13, 2022 at 4:09
• Unfortunately blender does not support implicit functions, only explicit, but the resulting graph is the same depending on domain. But in your case the equation is not implicit because there is a way to make it explicit as shown in the answer. Implicit means if there is no way to find an explicit form. Also you can edit the resolution or specify a domain to get the specific portion of the graph u want. What's the math domain u need? It is missing in your question. Aug 15, 2022 at 4:10
• I just found out you can plot implicit equations using the volume cube node method in GN blender.stackexchange.com/a/300876/142292 Sep 11, 2023 at 8:54

You cannot plot an Implicit function in Blender. You will need another software to do that. You can plot an Implicit function using Volume Cube. However, your equation is not implicit because there is a way to convert it into an Explicit function. Implicit means that there is no way to convert it into explicit form. Here's a solution using Geometry Nodes that shows the graph for your original equation $$z^2+(x−y−1)(z)+y=0$$ using an explicit function that was derived from that original equation in my solution in the other answer:

$$z = \frac{1}{2}(y-x+1)\pm \frac{1}{2}\sqrt{\left(x−y−1\right)^{2} - 4y}$$

Take note that the jagged edges between the upper and lower graph are the exact representation of the boundary between real and imaginary (complex) numbers.

The equation $$z^2 + (x-y-1)(z) + y = 0$$ has the form of a Quadratic Equation so you can derive an explicit equation in the form $$z=z(x,y)$$

$$Az^2+Bz+C=0$$ where: $$A=1$$ $$B=(x-y-1)$$ $$C=y$$

and $$z$$ can be explicitly defined as: $$z=\frac{-B\pm\sqrt{B^2-4AC}}{2A}$$ substituting we get: $$z = \frac{-(x−y−1)\pm \sqrt{\left(x−y−1\right)^{2} - 4(1)(y)}}{2(1)}$$

$$z = \frac{1}{2}(y-x+1)\pm \frac{1}{2}\sqrt{x^2 - 2xy - 2x + y^2 + 2y + 1 - 4y}$$

There are two (2) solutions:

z = (y-x+1)*0.5 + ((x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 - 4*y)**(0.5))*0.5
z = (y-x+1)*0.5 - ((x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 - 4*y)**(0.5))*0.5


Take note that we have an imaginary component, where, $$x^2 - 2xy - 2x + y^2 + 2y + 1$$ has to be greater than $$4y$$ or else we have a negative value in the square root function ($$\sqrt{value}=value^{0.5}$$) which would result to an imaginary number and cannot be visualized so we have to add a check to ignore these points. We can easily plot that in python without any problems:

import bpy

def get_object(name):
objects = bpy.context.scene.objects
if name in objects:
return objects[name]
m = bpy.data.meshes.new(name + "-mesh")
o = bpy.data.objects.new(name, m)
#o.modifiers.new(name, 'SKIN')
return o

# ==================================================================================================
# Equation:
# Descritpion: plot z = (y-x+1)*0.5 +/- ((x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 - 4*y)**(0.5))*0.5
# ==================================================================================================

def get_range(start, end, step = 2):
return [x * 0.1 for x in range(start * 10, end * 10, step)]

def get_graph_z_real(x, y):
return x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 - 4*y

def get_graph_z(x, y, real, sign = 1):
return (y-x+1)*0.5 + (real**0.5)*0.5 * sign

def create_verts(verts, sign):
for py in get_range(-5, 5, 2):
for px in get_range(-5, 5, 2):
real = get_graph_z_real(px, py)
if real < 0:
continue
pz = get_graph_z(px, py, real, sign)
verts.append([px, py, pz])

def draw_graph():
verts = []

create_verts(verts, 1)
create_verts(verts, -1)

o = get_object("graph")
m = o.data
m.clear_geometry()
m.from_pydata(verts, (), ())

draw_graph()


And then you can use the method described in How can I convert a complex point cloud to mesh to convert it to a mesh.

We can also use the Z Math Surface but unfortunately there we have to add an if/else check and evaluate the square root part to zero or some other value for the imaginary component which will add an additional unwanted region in the 3d surface:

z = (y-x+1)*0.5 + ((x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 - 4*y if x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 > 4*y else 0)**(0.5))*0.5
z = (y-x+1)*0.5 - ((x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 - 4*y if x**2 - 2*x*y - 2*x + y**2 + 2*y + 1 > 4*y else 0)**(0.5))*0.5