Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have ellipse in 2D. I want to compute fixed number of points on this ellipse with constant angular seperation between those points.

My first idea was to generate line equations from center of the ellipse and then solve equations of these lines with ellipse equation. But it's not effictient computationaly. Second idea is to use equation in polar coordinates and vary t from 0 to 2pi with overlap 2pi/numberOfPoints.

What is the simpliest(less computionaly absorbing) method to get fixed ellipse points number?

share|improve this question
1  
How are you measuring the distance? Straight line, or along the ellipse? (Or angular separation?) –  TonyK May 31 '12 at 9:01
    
Distance is measured by angular seperation. –  krzych May 31 '12 at 9:10
    
Are you stuck on using the center as the point of reference as opposed to one of the focal points? In the latter case the equation takes a relatively simple form in polar coordinates. If the axes of the ellipse are not aligned with $x/y$-axes, then just subtract a constant from $\theta$. –  Jyrki Lahtonen May 31 '12 at 11:05
    
I can't figure out x and y from these equation. Also some good graphic representation of this equation would be helpful. I found some but still can't obtain what I need. –  krzych Jun 1 '12 at 6:56

1 Answer 1

up vote 1 down vote accepted

If you insist on having equal angular increments, the equations are:

$$ k = \frac{1}{\sqrt{ {b^2}\cos^2{\theta} + {a^2}\sin^2{\theta} }}$$

$$ x = kab\cos{\theta}$$

$$ y = kab\sin{\theta}$$

So, you have to compute a sine, a cosine, and a square root for each given value of $\theta$. Not too much for a typical modern computer, I would think.

But, since you are going to use equal increments of $\theta$, there's an old-time computer graphics trick that reduces the computation. Suppose we let $\delta\theta$ denote the angular increment. Then we know that

$$ \cos(\theta + \delta\theta) = \cos\theta\cos\delta\theta - \sin\theta\sin\delta\theta $$

$$ \sin(\theta + \delta\theta) = \sin\theta\cos\delta\theta + \cos\theta\sin\delta\theta $$

You pre-compute $\cos\delta\theta$ and $\sin\delta\theta$. Then you can compute each incremented value of $\cos(\theta + \delta\theta)$ and $\sin(\theta + \delta\theta)$ with just four multiplies and two adds.

share|improve this answer

Your Answer

 
discard

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.