1

I need to calculate a point on ellipse based on elliptic rotation angle. Though I am using the same formula as for circle (a = horizontal radius, b = vertical radius): $$ x = a * cos(\alpha) $$ $$ y = b * sin(\alpha) $$

Wierd thing is happening as per the following diagram: ellipticAngle

Searching online I find that my formula is the standard formula of calculation - however, as per my understanding (and maybe I am missing something), 45degrees should be in exact 50% from start point (0) to straight angle (90deg.) So if we go in radians, computer using it for easy arc calculation. Here it becomming somehow incorrect....

The question: Is there any way to "correctly" calculate rotation angle so it follows up rotation length (like in circle radians are)?

Thanks a lot

Xerix
  • 123
  • In what sense is the blue dot "50% of the way from 0 to 90 degrees?" Are you saying that the blue dot is halfway along the ellipse's perimeter between the two orange dots? – heropup Apr 20 '23 at 01:39
  • Yes, we may say we have 2*PI radians in a circle because this is the perimeter length if Radius is 1 (used for easy calculations). In ellipse its known to be a problem... So a converting "angle" formula is needed. – Xerix Apr 20 '23 at 01:47
  • 2
    Radians are defined in terms of a circle because that way congruent angles (for example at vertices of similar triangles) all have the same angle measure. Your "elliptic rotation angle" doesn't have this property. I don't understand why you are using the word "angle" this way when you could simply say "arc length". – David K Apr 20 '23 at 07:08
  • If you're interested in polar angle as in polar coordinates, you may refer to my older post here. – Ng Chung Tak Apr 20 '23 at 11:40
  • In case you're interested in the aspect of arc length, you could refer to another posts of mine here and here. – Ng Chung Tak Apr 20 '23 at 11:41

2 Answers2

0

Ellipses are really hard to work with, since there is no simple, exact formula for their perimeter. (There are simple formulas but they are not exact, and there are exact formulas but they are not simple.) Constant increase in angular measure does not correspond to a constant increase in arclength, so special tools are needed that are beyond my knowledge and understanding.

John
  • 179
  • 15
0

Given an ellipse of parametric equations:

$$ (x,y) = (a\cos\alpha,b\sin\alpha) \quad \quad \quad \text{with} \; \alpha \in [0,2\pi) $$

the length of an arc between $\alpha=0$ and $\alpha=\beta$ is defined as:

$$ \mathcal{L}(\beta) := \int_0^{\beta} \underbrace{\sqrt{(a\sin\alpha)^2+(b\cos\alpha)^2}}_{f(\alpha)}\,\text{d}\alpha\,. $$

Therefore, set $\Delta\beta \equiv 2\pi/n$, expanding $\mathcal{L}$ into first order Taylor series:

$$ \mathcal{L}(\beta+\Delta\beta) \approx \mathcal{L}(\beta) + \mathcal{L}'(\beta)\,\Delta\beta $$

it's possible consider the following numerical procedure (Euler's method):

$$ \begin{cases} \beta_0 = 0 \\ \mathcal{L}_0 = \dots \\ \end{cases} \quad \quad \quad \begin{cases} \beta_i = \beta_{i-1} + \Delta\beta \\ \mathcal{L}_i = \mathcal{L}_{i-1} + f(\beta_{i-1})\,\Delta\beta \\ \end{cases} \quad \quad \quad i = 1,2,\dots,n $$

through which we can achieve our goal in two steps:

  • let $\mathcal{L}_0 = 0$, it's possible to calculate the length of the ellipse $\mathcal{L}_e\equiv\mathcal{L}_n$;

  • let $\mathcal{L}_0 = -\lambda\,\mathcal{L}_e$ with $0 < \lambda < 1$, it's possible to calculate the desidered angle $\beta_{\lambda}\equiv\frac{\beta_{m-1}+\beta_m}{2}$, where $m<n$ is the index for which it's possible to stop the procedure when $\mathcal{L}_{m-1}\cdot\mathcal{L}_m<0$.

Finally, the angle $0 \le \gamma_{\lambda} < 2\pi$ between the vectors $(1,0)$ and $(x,y) = (a\cos\beta_{\lambda},b\sin\beta_{\lambda})$ is:

$$ \gamma_{\lambda} = \begin{cases} \arccos\left(\frac{x}{\sqrt{x^2+y^2}}\right) & \text{if} \; y \ge 0 \\ 2\pi - \arccos\left(\frac{x}{\sqrt{x^2+y^2}}\right) & \text{if} \; y<0 \\ \end{cases} $$

where only in the particular case of the circle $a=b$ we have $\gamma_{\lambda}=\beta_{\lambda}$ for all $\beta_{\lambda} \in [0,2\pi)$.

  • I have checked the following formula, and it goes from 0 to 0.5 in for y>0 and deduct 0 to 0.5 from 2*PI in the other half-turn. Adjusting it a bit bring me back to the normal elliptic angle with inaccurate location.... – Xerix Apr 21 '23 at 05:17
  • Yes, this I understod. But then I got in γλ result which goes from 0 (for βλ = 0) to 0.5 (for βλ = π) which is the case for y>0 (ellipse radiusX = 100, ellipse radiusY = 50): x = 100 * cos(βλ)
    y = 50 * sin(βλ)
    γλ = arccos ( x / sqrt ( x * x + y * y ) )

    γλ = 0, βλ = 0
    γλ = 0.03250255418931605, βλ = 0.0625
    γλ = 0.07379180882521665, βλ = 0.125
    γλ = 0.13989091045067742, βλ = 0.1875
    γλ = 0.25, βλ = 0.25
    γλ = 0.3601090895493226, βλ = 0.3125
    γλ = 0.42620819117478337, βλ = 0.375
    γλ = 0.467497445810684, βλ = 0.4375
    γλ = 0.5, βλ = 0.5

    – Xerix Apr 21 '23 at 08:58