Geez, I was bein silly when I said that this special case cannot readily be solved. In fact in the special case we have:
2 * (-h3 + h2) / (h1 - h3) = 1/x + 1 - sqrt(1/x**2 + 1)
Let's declare that value to be a constant K. Then:
K - 1 - 1/x = - sqrt(1/x**2 + 1) K**2 - 2K - 2K/x + 1 + 2/x + 1/x**2 = 1/x**2 + 1 K**2 - 2K = (2K - 2)/x x = 2(K-1)/(K**2 - 2K)
and so we can calculate K, and then calculate X, and then calculate everything else.

But what about the general case? Well I half-way retract my analytic comment. There is an analytic approach - but it will be useless for practical purposes.

As above, you can get rid of H and S by subtracting one from the rest, then dividing the rest by one remaining. That gives you 2 complex equations in various square roots of x and y. With a couple of squarings, both those equations can be turned into 4'th degree polynomials in x and y. There is an analytic solution to 4th degree polynomials (but it is very complex), so you can find y in terms of x and the other junk, and get high-order equation in terms of x alone. With some more manipulation that can be turned into a polynomial, and there is a general solution known to n'th degree polynomials using integrals.

So in principle you can write down an exact solution. But the solution will be absurdly complex, and probably won't be as easy to calculate as a naive numerical approach.


In reply to Re^4: OT:Math problem: Grids and conical sections. by tilly
in thread OT:Math problem: Grids and conical sections. by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.