# How to calculate the distance from a point on ellipse arc to the chord

Now I have an ellipse-arc starting at $$A$$ and ending at $$B$$, so $$AB$$ is the chord of the ellipse-arc. I want to know how to calculate the maximum distance from the points on the ellipise-arc to the chord.

• What have you tried so far? – dromniscience Nov 1 '20 at 11:05
• I have no way! I am looking for some papers or books that can show me something. – fosuwxb Nov 1 '20 at 11:39
• Context and source of problem? What are tools allowed - Euclidean geometry, Calculus or something else? – cosmo5 Nov 1 '20 at 12:21
• And what exactly is given? A chord and equation of arc, or semimajor axes also known? – cosmo5 Nov 1 '20 at 12:22
• I mean the Euclidean geometry. I want a general formula. Suppose the majorAxle, the minorAxle and the center the ellipse arc were known. – fosuwxb Nov 1 '20 at 12:33

Not a full answer, but too long to be a comment:

Let $$A,B\in\mathbb{R}^2$$ be (given) points which lie in the ellipse, and the ellipse to be represented by all points $$x\in\mathbb{R}^2$$ which comply $$x^TMx=1$$ for some positive definite matrix $$M$$. Moreover, the chord from $$A$$ to $$B$$ is parametrized by all points $$y$$ which comply $$y=\lambda A + (1-\lambda)B$$ with $$\lambda\in[0,1]$$. Thus, if I understood correctly, you want to solve the optimization program: \begin{aligned} D=\max_{x,\lambda}\ &\|x-(\lambda A + (1-\lambda)B)\|\\ s.t.\ \ & x^TMx=1\\ & 0\leq \lambda\leq 1 \end{aligned} Or equivalently \begin{aligned} D=\max_{x,\lambda}\ &(x-(\lambda A + (1-\lambda)B))^T(x-(\lambda A + (1-\lambda)B))\\ s.t.\ \ & x^TMx=1\\ & 0\leq \lambda\leq 1 \end{aligned} Note that if you ignore the constraint $$0\leq \lambda\leq 1$$ thus, the solution would be $$D=\infty$$ since points in the line $$\lambda A + (1-\lambda)B$$ can go all the way to infinity. So we can't ignore $$0\leq \lambda\leq 1$$. I'm saying this since if you were interested in the minimum distance instead of the maximum, you could ignore $$0\leq \lambda\leq 1$$, and thus use Lagrange multipliers to solve the previous problem and maybe find an explicit formula.

Now, in your case, at this point I see no other way but to solve this problem numerically. Due to the geometry of the problem, I think one may be able to show that there is a unique maximizer (but I don't have this clear right now). So using a numerical solver such as $$\texttt{fmincon}$$ from MATLAB should be able to do the work.

Now, note that my approach could be an overkill. Another contributor, more skilled in geometry than me, may find a clever argument to solve this problem more easily.

Presumably you know something about the ellipse, perhaps $$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1$$

and presumably you know something about $$A$$ and $$B$$, perhaps that they are where $$y=mx+c$$ intersects the ellipse

Then you can say that the tangents to the ellipse parallel to $$AB$$ can be expressed as $$y = mx \pm \sqrt{a^2m^2+b^2}$$

and the maximum distance from the the ellipise-arc to the chord is $$\dfrac{|c\mp \sqrt{a^2m^2+b^2}|}{\sqrt{1+m^2}}$$

with the $$\pm$$ and $$\mp$$ determined by which of the two arcs resulting from the chord you are referring to.

Let $$O$$ be the centre of the ellipse, $$M$$ the midpoint of $$AB$$ and $$P$$ the intersection between line $$OM$$ and arc $$AB$$. The tangent through $$P$$ is parallel to $$AB$$, hence you just need to compute the distance from $$P$$ to line $$AB$$.

• Is there a formula for what you said, say, a formula of the sagitta that is derived from the majoraxis, minoraxis and the chord or starting angle /ending angle and the necessary geometric conditions? – fosuwxb Nov 2 '20 at 11:14
• @fosuwxb I'm afraid such a formula could be quite complicated. – Intelligenti pauca Nov 2 '20 at 11:59