Wow. I am impressed. This is solveable analytically!

First one note. Your equation for a cone only works if m is the slope squared. Then follow this derivation (I've marked the important equations with ****):

Point 1: (1, 0) at height h1
Eqn 1:
  (x-1)2 + y2 = m(z - h1)2
  x2 - 2x + 1 + y2 = m(z2 - 2zh1 + h12)
  **** step 4

Point 2: (0, 1) at height h2
Eqn 2:
  x2 + (y-1)2 = m(z - h2)2
  x2 + y2 - 2y + 1 = m(z2 - 2zh2 + h22)

Point 3: (-1,0)) at height h3
Eqn 3:
  (x+1)2 + y2 = m(z - h3)2
  x2 + 2x + 1 + y2 = m(z2 - 2zh3 + h32)

Point 4: (0, -1) at height h4
Eqn 4:
  x2 + (y+1)2 = m(z - h4)2
  x2 + y2 + 2y + 1 = m(z2 - 2zh4 + h42)

-------------------------------------------------------

(Eqn 2 - Eqn 1)/m:
  2(x - y)/m = -2zh2 + h22 + 2zh1 - h12

(Eqn 3 - Eqn 4)/m:
  2(x - y)/m = -2zh3 + h32 + 2zh4 - h42

Combine to get:

  -2zh2 + h22 + 2zh1 - h12 = -2zh3 + h32 + 2zh4 - h42
  2z(h1 - h2 + h3 - h4) = h12 - h22 + h32 - h42
  z = 0.5(h12 - h22 + h32 - h42)/(h1 - h2 + h3 - h4)
  **** step 1

-------------------------------------------------------

(Eqn 3 - Eqn 1)/4:

  x = 0.25m(-2zh3 + h32 + 2zh1 - h12)
  **** step 2

 (Eqn 4 - Eqn 2)/4:

  y = 0.25m(-2zh4 + h42 + 2zh2 - h22)
  **** step 3
And now we can use step 1 to find z, use steps 2 and 3 to substitute into step 4 to come up with a quadratic equation in m. Solve for m (remember that that's the slope squared). Substitute m back into steps 2 and 3 to find x and y.

Whew!

Update: Typos fixed. Had a - where I needed a +, and 4 when I needed 2.


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.