Can someone show me a picture of the nodes for the following equation?
$$ \left(x - x\left(\frac{z}a\right)\right)^2 + \left(y - y\left(\frac{z}a\right)\right)^2 = r^2 $$
The following Cartesian Equation is of Implicit Type.
$$ \left(x - x\left(\frac{z}a\right)\right)^2 + \left(y - y\left(\frac{z}a\right)\right)^2 = r^2 $$
Quoting from What are Implicit Equations:
Let's say that $y$ is the dependent variable and $x$ is the independent variable. An explicit solution would be $y=f(x)$, i.e. $y$ is expressed in terms of $x$ only.
An implicit solution is when you have $f(x,y)=g(x,y)$ which means that $y$ and $x$ are mixed together. $y$ is not expressed in terms of $x$ only. You can have $x$ and $y$ on both sides of the equal sign or you can have $y$ on one side and $x,y$ on the other side. An example of implicit solution is $y=x(x+y)^2$
Thus you cannot directly use this type of equation from the Cartesian coordinate system in Geometry Nodes. Points in Euclidean space can be written in either Cartesian or the Polar Coordinate System (extended into Cylindrical and Spherical Coordinate System). In order for the equation to be usable in your case, it needs to be transformed into a form called Parametric Equations which operate on the 3D Polar Coordinate System. That is, it needs to be of the form: $$ x = x(u, v)$$ $$ y = y(u, v)$$ $$ z = z(u, v)$$
You may be able to simplify the original equation to: $$(x^2+y^2)(1−(z/a))^2=r^2$$ But note that the term $1−(z/a)$ is unbounded and thus this equation has infinite potential solutions for possible equations as long as they satisfy the original cartesian equation. Please see one solution I have prepared on the Math Stack Exchange. Here I have prepared one (1) of many possible sets of solutions from the family of circular base solutions.
$$x=r\cos{u}\sin{v}$$ $$y=r\sin{u}\sin{v}$$ $$z=a\pm\frac{a}{\sin{v}}$$
Note from the solution provided in the math link:
- In the above results, for this particular form only, $z=z(v)$ only.
- In general, $z=z(u,v)$ as long as it satisfies Eq. (6).
- We can solve Eq. (6), as a quadratic equation because, we can also assume that $z=z(v)$ for illustrative purposes only.
- In other words, there can be many other forms of solutions as long as they satisfy Eq. (6), for the same equations for $x=x(u,v)$ and $y=y(u,v)$, given by Eq. (3).
Now you are able to use these parametric equations in Geometry Nodes similarly solved as to Robin Bett's answer:
Here's the resulting graph for this particular set of solution:
Although not as exact as the first solution I have made with better topology, it is also possible with Volume Cube node and fewer nodes using the original implicit equation:
$$ \left(x - x\left(\frac{z}a\right)\right)^2 + \left(y - y\left(\frac{z}a\right)\right)^2 = r^2 $$
Math
(you can find it in the group "Utilities") and show us what progress you could make. ...I think the node is quite useful in this case. $\endgroup$