Specific cartesian coordinates of an ellipse

108 Views Asked by At

I want to do the following:


1.) Ask user for the vertical and horizontal distances of the ellipse

2.) With this information calculate the circumference

3.) Divide the circumference by the closest even number to give as close to 1 unit as a value for 'r'

4.) Use the 'r' value and an angle output by a formula which would take the above into account to find the next point.

5.) Repeat point by point going around the ellipse until the original point is arrived at


Any ideas how I could learn what is required to arrive at the correct angle increments between my points. It is important for me to have equally spaced 'r' values.

I did a similar thing to output circle coordinates in this sheet. Click the 'roundabout' tab.

1

There are 1 best solutions below

0
On BEST ANSWER

What you want to do is more complicated for an ellipse than for a circle because it requires the use of special functions : First, the "complete elliptic integral of the second kind" to compute the perimeter. See formulas (63, 64, 65) in http://mathworld.wolfram.com/Ellipse.html If an high accuracy is not required, there are some approximate formulas (69, 70, 71) for example.

The length of an arc of the ellipse (given the polar coordinates of the begining and end of the arc) is computed thanks to the "incomplete elliptique integral of the second kind": http://mathworld.wolfram.com/EllipticIntegraloftheSecondKind.html

So, after computing the length on one arc, as said in the wording of the question, you have to compute the polar coordinate of each end of the successive arcs. This is even more complicated, because it requires the inverse function of the preceeding one, say the "inverse elliptic integral of the second kind".

Instead of analytical method as mention above, in practice it is probably simpler to proceed by numerical method of computation. In polar system of coordinates, define a very small incremental length of arc. Numerically integrate to find an approximate value of the perimeter. Then, after computing the length on one arc, as said in the wording of the question, sweep again and meanwhile stop each time the length of an arc is obtain. This will give the successive points on the ellipse.