0
$\begingroup$

Given an ellipse with defined major and minor axes and a chord, $AB$, that exists on said ellipse how can I calculate the 2 valid $(h,k)$ offset pairs?

For example, with $A = (312, 110)$ and $B = (412, 210)$ is there a procedural way to solve for the possible $h$ and $k$ values in: $$\left(\frac{x-h}{64}\right)^2 + \left(\frac{y-k}{117}\right)^2 = 1$$I'm sure it's possible to solve this by substitution but my end goal is to determine these values programmatically for various points and radii so that doesn't appear to be a viable solution for me.

Thanks for your time.

EDIT:
I'm currently trying to use the generalized forms $$\left(\frac{A_x-h}{r_x}\right)^2+\left(\frac{A_y-k}{r_y}\right)^2=1$$ and $$\left(\frac{B_x-h}{r_x}\right)^2+\left(\frac{B_y-k}{r_y}\right)^2=1$$ to solve for $h=$ (some set of defined variables) and $k=$ (some set of defined variables) but the equations get nasty fairly quickly and I'm not even sure I'm on the right track here.

1 Answers 1

0

Hint: write the two equations as:

$$ \begin{cases} 117^2(312-h)^2+64^2(110-k)^2=64^2\,117^2 \\ 117^2(412-h)^2+64^2(210-k)^2=64^2\,117^2 \end{cases} $$

Expand:

\begin{cases} 117^2(312^2-2\cdot 312\,h+h^2)+64^2(110^2 - 2 \cdot 110 k+k^2)=64^2\,117^2 \\ 117^2(412^2-2\cdot 412\,h+h^2)+64^2(210^2 - 2 \cdot 210 k+k^2)=64^2\,117^2 \end{cases}

Subtract the first equation from the second, cancel out the terms in $h^2,k^2$ and group the rest:

$$ 117^2(412-312)(412+312-2h)+64^2(210-110)(210+110-2k) = 0 $$

Then $\require{cancel} k=\cfrac{1}{2}\left(\cfrac{117^2}{64^2}\,\cfrac{\cancel{100}}{\cancel{100}}\,(724-2h)+320\right)\,$, and substituting back into either of the original equations gives a quadratic in $h$. A similar approach works for arbitrary points $(x_1,y_1), (x_2,y_2)\,$.


[ EDIT ]   Regarding the comment that a computer will be following these steps, the above is the math answer to the question, but not necessarily the best computer implementation of it.

A more sensible algorithm computer-wise could be:

  • normalize the problem: in OP's notation, define $a_x'=A_x/r_x, h'=h/r_x\,$ etc:

$$ \begin{cases} \begin{align} (a_x' - h')^2 + (a_y' - k')^2=1 \\ (b_x' - h')^2 + (b_y' - k')^2=1 \end{align} \end{cases} $$

  • solve the normalized system for $h',k'$ using the approach outlined in the original answer;

  • revert to the original variables $h = r_x h', k=r_y k'\,$ for the final solution(s).

  • 0
    This has been a great help getting started, and it shows I was on the right track, but since a computer will be following these steps and not an intelligent human being I can't combine and simplify terms as you have done. I've worked out a general form for _k=_ but once I substitute that into one of the original equations I start losing a third of a page every time I change something and I'm just as lost as before.2017-02-07
  • 0
    @Khepri Telling the computer how to best work out a calculation is a programming matter, rather than a math one. I edited my answer to add a thought on that.2017-02-07