I am trying to develop a surface level visualizer using this method (I don’t know if this is a standard method or if something is better):
f(x,y,z)=k (where k is a constant) and the boundaries for x, y and z. Also take two grid options stepX and stepZ.
- 2. To reduce to the level of the problem curve, iterations from zMin to zMax with the interval stepZ. So,
f(x,y,z)=k => f(x,y,fixedZ)=k- 3. Repeat the same procedure with stepX, reducing the problem to
f(fixedX, y, fixedZ)=kf(fixedX, y, fixedZ) - k = 0 for all y values that will satisfy this equation (using some kind of root search algorithm).
- 5. For all created points, draw them as a level curve (the inner loop generates level curves for a given z, then for different z values there are only stacks of level curves)
- 6 (optional). Create a grid of these level / point curves that belong to a set of levels.
The problem I am facing is step 4. I do not know how many possible y values satisfy this equation (more precisely, how many unique and real y values).
In addition, I try to make the program as general as possible, so I try not to restrict the original function f(x,y,z)=k any constraints, such as smoothness or a polynomial other than k, that should be constant as required for level surface.
Is there an algorithm (without using a CAS / symbolic solution) that can identify the root of a function, even if it has multiple roots? I know that bisection methods are not easy with this because of the possibility of any sign changes by region, but how does the secant / newtons method work? What set of functions can the secant / newtons method use, and can it detect and find all the unique real roots within two given boundaries? Or is there a better method for creating / visualizing level surfaces?
source share