Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For a simulation, I need to create a function $r(\theta,\phi)$ that has minima at specific pairs of $(\theta,\phi)$, and that is periodic, i.e. $r(\theta,\phi) = r(\theta+2\pi,\phi)$ and $r(\theta,\phi) = r(\theta,\phi+2\pi)$ etc. At least the first and second derivatives of the function should be continuous.

How can I construct such a function? I imagine that when drawn as a surface, it will look a bit like a bowling ball, but without the sharp edges.

EDIT I can imagine several ways of creating a function with a single minimum at $(\theta_0,\phi_0)$, but I am stuck creating a function that has a second (or third) minumum at e.g. $(\theta_1,\phi_1)$, but not at $(\theta_0,\phi_1)$ or $(\theta_1,\phi_0)$

share|cite|improve this question

$$ r(\theta,\phi) = (1-\cos(\theta-\theta_0))\cdot(1-\cos(\phi-\phi_0)) $$

looks like a good candidate :)

share|cite|improve this answer
Thank you for your suggestion! This is what I originally started with. How can I adapt it to multiple minima? – Jonas Oct 10 '12 at 18:09

The function $r(\theta,\phi)=\sin(\theta)+\cos(\phi)$ has the periodicity wanted, and is minimized at point $(\frac{3\pi}{2}+2k\pi,\pi+2k\pi), k\in \mathbb{Z}$.

share|cite|improve this answer
I apologize for not being clear. I can manage single minima, but how would I do multiples? – Jonas Oct 10 '12 at 18:09
What do you mean multiples minima, this one as an infinity of them – Jean-Sébastien Oct 10 '12 at 18:10
I believe he would like to have a function that has a given number of minima in $(0, 2\pi)$ – peterm Oct 10 '12 at 18:15
@Jean-Sébastien: Yes, user44010 is correct. – Jonas Oct 10 '12 at 19:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.