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

I am trying to simulate the movement of a particle in a vortex in a rectangular box, I am currently using an ellipse but that causes the particle to collide with the walls more that I want.

The equation doesn't have to be exact, I am thinking for instance in to augment or reduce the mayor and minor diameter of my ellipse accordingly to, let's say the angle t in relation to angle a

I just wanted to know whether there is some equation that descrives that trajectory

Also, I want to be able to calculate the tangent vector

The following image shows what I've mentioned

Any help is appreciated

share|cite|improve this question
Is it a point vortex at the center of the box, or is vorticity uniformly distributed over all of the interior? – Rahul Oct 16 '12 at 9:59
I guess is a vorticity uniformly distributed, think of a outboard motor in the x axis near one wall pointing up or down side the y axis, in that case the tangent vector magnitud could be proportional to the angle t – rraallvv Oct 16 '12 at 17:56
up vote 0 down vote accepted

How about a superellipse (with $n = 4$ or $n = 6$, say):

The article gives the parametric equations, so you can calculate derivatives (tangents).

If you're willing to use a piecewise formula, then 4 rational quadratics (i.e. conics) would work. See

share|cite|improve this answer
Caveat: I know absolutely nothing about vorticity; I'm just trying to give you curves that are shaped like the one in your picture. – bubba Oct 16 '12 at 10:17
I'll try both to see which one is less expensive in CPU cycles, I didn't mention though, it must run on a mobil device – rraallvv Oct 16 '12 at 18:01
The rational quadratic approach will require less computation -- no trig functions. You could even use 4 plain Bezier cubic curves. This would require even less computation. The downside is that regular cubics can't produce very "sharp" corners. Maybe sharp enough, though. – bubba Oct 16 '12 at 23:21
I've tried a couple of functions on my own too, and found a very nice hyperbolic curve that appears a super-ellipse when drawn from 0 to 1, It's [ Ay - 1] * [ Ax - 1] = 1 - A; see…; but even better, it looks very cheap computationaly speaking – rraallvv Oct 17 '12 at 7:17

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.