2

I have been wondering on how to properly uniformly samples points on the curve of an ellipse using well-explored, given workflow. That is, consider the following parametric representation of an ellipse: $$ x = a r \cos(t) $$ $$ y = b r \sin(t) $$

, where $t\in[0, 2\pi) $

Note that parameter $r$ simply shrinks or enlarges the ellipse, and $a$ and $b$ are constants (axes).

Now, given the probability density in Cartesian coordinates p(x,y) (which is, as far as I am concerned, simply 1 over circumference of an ellipse (I originally said area, which is wrong, of course)) probability density in the new coordinate system can be found as follows: $$ p(r, t) = |J_t| p(x,y) $$ where $Jt=a b r$ is the Jacobian of transformation

At this point I tried to see if this new pdf integrates to 1, that is: $$ \int_0^{2\pi}p(r, t)dt $$

Note once again that I set $r$ to 1 and simply try to integrate over the domain of parameter $t$. Unfortunately, it just doesn't add up to 1. Consequently, having wrong pdf I can not proceed and apply inversion method to sample the points. Could you please point out the flaw in my reasoning? How is that my pdf does not integrate to 1? Thank you.

1 Answers1

2

It needs to be parametrized by arc length:

\begin{align*} ds &= r\sqrt{a^2\sin^2 t+b^2\cos^2 t} \, dt \\ S_\text{total} &= r\int_{0}^{2\pi} \sqrt{a^2\sin^2 t+b^2\cos^2 t} \, dt \\ &= 4raE\left( \sqrt{1-\frac{b^2}{a^2}} \right) \\ f(s) &= \frac{1}{4raE\left( \sqrt{1-\frac{b^2}{a^2}} \right)} \\ p_r(t) &= f(s) \times \frac{ds}{dt} \\ &= \frac{\sqrt{a^2\sin^2 t+b^2\cos^2 t}} {4aE\left( \sqrt{1-\frac{b^2}{a^2}} \right)} \end{align*}

where $E(\cdot)$ is complete elliptic integral of the second kind.

Caution

For partial arc length with $a>b$, $(a\sin \theta, b\cos \theta)$ or clockwise convention is used instead.

$$s(\theta)=a\int_{0}^{\theta} \sqrt{1-\left( 1-\frac{b^2}{a^2} \right)\sin^2\theta} \, d\theta = aE\left( \theta, \sqrt{1-\frac{b^2}{a^2}} \right)$$ where $E(\cdot, \cdot)$ is an incomplete elliptic integral of the second kind.

Ng Chung Tak
  • 19,693