Nice curvy $3D$ functions (typical math software logo)

163 Views Asked by At

Easy $3D$ functions with nice shape

Hello everyone,

I am searching for all those nice curvy functions that almost all math softwares throw around, but I have never been able to replicate it. What I mean is the following example:

curvy_1

What I need is the type of function that can create these nice hills and valleys while not shooting into space.

What I tried and why it does not work for me:

  • I tried polynomials but they just create only $3$ hills ($2$ for each variable and $1$ for combination) and one valley, considering I want non-negativity in variables. I would say it is not enough curvy.
  • Himmelblau's function starts to shoot into the space too fast. All modes are at the same "heigth" which is also not pleasant.
  • Multimodal functions with too many hills are too curvy on the other hand. I would need something more gentle.

Summary of what I would like:

  • Nice functional form (easy to implement and count with - something like polynomials)
  • Flexible (meaning that it is easy to change position of hills and valleys)
  • Not too many hills and valleys but not too few ($5$-$7$ shapes as in picture would be ok)
  • Gentle (not dramatic changes, not overshooting etc.)

Do you know about some function as this?

Thank you very much!

2

There are 2 best solutions below

0
On BEST ANSWER

How about this? I put this together very quickly, I'm sure it could be improved. Its just a bunch of Gaussians:

enter image description here

Link: https://www.math3d.org/UQh9ohGqt

1
On
  • As advised by Calvin Khor, you can obtain all the hills, valleys, passes, etc. you can desire by combining gaussians:

$$z=f(x,y)=\sum_{k=1}^n w_k \exp\left(-\frac{((x-m_k)+(y-n_k))^2}{2 v_k}\right)$$

for various means $(m_k,n_k)$, variances $v_k$ and weights $w_k$ (negative or positive).

  • The search can be enlarged to functions that haven't an explicit algebraic equation.

Among them, those involving distance function. Here is a graphical representation of the function

$$z=g(x,y)=\text{shortest distance from} \ (x,y) \ \text{to a set of points.}$$

Taking as set of points the union of 3 circles, we get narrow valleys between a crescent and two cones:

enter image description here

  • Another source of nice surfaces : complex functions ($Z=f(z)$) either by plotting their modulus or their argument. Here is for example a graphical representation of the modulus of a rational fraction

$$f(x,y)=\left|\frac{a z^3+ bz^4+...}{a' z^5+ b'z^4+...}\right|$$

(where $z=x+iy$) with $3$ roots (of the numerator, generating cones touching the horizontal plane) and $5$ poles (roots of the denominator, generating "chimneys"). Level lines have been represented on the horizontal plane ; at the level of saddle points, these level lines may take the form of lemniscates (shape of the "infinite symbol" $\infty$).

enter image description here

(I have generated both images with Matlab)