in reply to Re^3: OT:Math problem: Grids and conical sections.
in thread OT:Math problem: Grids and conical sections.

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.

  • Comment on Re^4: OT:Math problem: Grids and conical sections.

Replies are listed 'Best First'.
Re^5: OT:Math problem: Grids and conical sections.
by jeffguy (Sexton) on Nov 26, 2005 at 01:16 UTC
    Great job, Tilly! I just got it over here and then checked "Newest Nodes" before posting.
    You beat me to the punch!

    I'll try to transform my coordinates into yours for this post....

    <UPDATE>After all the excitement of thinking I had a different way of acheiving the solution than Tilly, it turns out it's basically the same. I'm leaving the post alive because it may be nice to have the solution to that final quadratic equation, which I include at the end.</UPDATE>

    Once getting z as you did, I plugged back into the original equation (x-x')^2+(y-y')^2=(z-z')^2/m^2 using each point for (x',y') and h1..h4 for z'. This gave me four equations (xx means x^2):

    xx-2x+1+yy =aa/mm xx+2x+1+yy =cc/mm xx +yy-2y+1=bb/mm xx +yy+2y+1=dd/mm
    I subtracted the first two to get 4*x*m*m=h3^2-h1^2.
    I subtracted the last two to get 4*y*m*m=h4^2-h2^2.
    Dividing these two values: 4*y*m*m/(4*x*m*m)=(h4^2-h2^2)/(h3^2-h1^2)
    Simplifying: y/x=(h4^2-h2^2)/(h3^2-h1^2)
    Then I plugged back into the original equation with just one point (1,0):
    Let k=y/x=(h4^2-h2^2)/(h3^2-h1^2) (from above) Let n=x*m*m=(h3^2-h1^2)/4 (from above) Original equation: (x-x')^2+(y-y')^2=(z-z')^2/m^2 (x-1 )^2+(y-0 )^2=(h1 )^2/m^2 (x-1 )^2+(xk-0)^2=(h1 )^2*x/n (x-1 )^2+(xk-0)^2=(h1 )^2*x/n multiplying it out: x^2-2x+1+x^2*k^2 =x*h1^2/n combining terms: x^2*(1+k^2)-x(2+h1^2/n)+1=0 let a=1+k^2 let b=2+h1^2/n x1=(b+sqrt(b^2-4a))/2a x2=(b-sqrt(b^2-4a))/2a y1=k*x1 y2=k*x2
    Sadly, only one of (x1,y1) or (x2,y2) is a valid solution.
      The reason that our solutions are the same is that I copied your explanation of how to do it. My attempts got lots of 4th degree polynomials and stuff which weren't simplifying.

      Nice++. Thanks for persisting even after my belief it was possible started to wane.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re^5: OT:Math problem: Grids and conical sections.
by BrowserUk (Patriarch) on Nov 28, 2005 at 11:27 UTC

    There appears to be an error in your calculations or transcription of them.

    Specifically, the sign of the 

    y2
     component of equation 1, changes between the original form
        (x-1)2 + y2 = m(z - h1)2
    ___________^
    

    and it's expansion:

        x2 - 2x + 1 - y2 = m(z2 - 2zh1 + h12)
    ________________^
    

    I don't follow the steps you used in the next stage of the reduction, (Eq.2 - Eq.1)/m, so I am unable to filter the correction through the rest of the workings.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      The error was in my transcription. That sign error was irrelevant because, no matter what I typed, I knew that the squares cancelled out.

      Your trouble following the next step was due to another typo, 4 instead of 2. The idea goes like this:

      Eqn 2 - Eqn 1:
      
        (x2 + y2 - 2y + 1)
          - (x2 - 2x + 1 + y2)
            = m(z2 - 2zh2 + h22)
              - m(z2 - 2zh1 + h12)
      
        -2y + 2x
          = m(- 2zh2 + h22 + 2zh1 - h12)
      
      Now divide both sides by m. Do the same for the other equation.