• finding a point

    From Hul Tytus@21:1/5 to All on Thu Oct 12 08:36:43 2017
    comp.graphics.algorithms
    finding a point relative to 3 others

    Given a triangle with the distance of all three sides known and an extra point above that triangle with the distance to each of the triangle's points known, how is the height of the extra point above the plane of the triangle found? This looks like there should be a simple solution, but I can't see
    it. Any suggestions?

    Hul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker@21:1/5 to All on Thu Oct 12 22:59:33 2017
    Am 12.10.2017 um 10:36 schrieb Hul Tytus:

    Given a triangle with the distance of all three sides known

    I'll assume you meant _lengths_ of all three sides.

    and an extra
    point above that triangle with the distance to each of the triangle's points known, how is the height of the extra point above the plane of the triangle found?

    In other words, you know the lenghts of all 6 sides of a tetrahedron in
    3D space: AB, BC, AC, AD, BD and CD. Now you want to know one of its 4 heights.

    This looks like there should be a simple solution, but I can't see
    it.

    "Simple" is relative. Without loss of generality you have 6 degrees of
    freedom for the positions of the 4 vertices of this tetrahedron, in a coordinate system of your own choosing

    A = ( 0, 0, 0)
    B = (xB, 0, 0) | xB > 0
    C = (xC, yC, 0) | yC > 0
    D = (xD, yD, z) | z > 0

    and 6 conditions to impose of them: the six lengths mentioned before:

    AB = xB
    AC^2 = xC^2+yC^2
    BC^2 = (xB-xC)^2 + yC^2
    AD^2 = xD^2 + yD^2 + z^2
    BD^2 = (xD-xB)^2 + yD^2 + z^2
    CD^2 = (xD-xC)^2 + (yD-yC)^2 + z^2

    Now all you have to do is solve this set of equations :-)

    xB = AB is obvious. Subtracting equations 2 and 3 eventually yields:

    BC^2 - AC^2 = AB^2 -2*AB*xC
    xC = (AB^2 - BC^2 + AC^2) / (2 * AB)

    and putting that back into the second equation, you get:

    yC = sqrt(AC^2 -xC^2)

    Subtract equations 4 and 5 to get:

    BD^2 - AD^2 = (xD - AB)^2- xD^2
    = -2*xD*AB + AB^2
    xD = (AB^2 - BD^2 + AD^2) / (2*AB)

    Subtract 5 and 6 to get

    BD^2 - CD^2 = (xD-xB)^2 - (xD-xC)^2 + yD^2 - (yD-yC)^2
    = (xD-xB)^2 - (xD-xC)^2 - 2*yD*yC + yC^2
    yD = (CD^2 - BD^2 + (xD-xB)^2 + (xD-xC)^2 + yC^2) / (2*yC)

    and finally

    z = sqrt(AD^2 - xD^2 - yD^2)

    It may pay off to pass the final results through a numerical solver to
    fight likely rounding errors incurred along the way.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hul Tytus@21:1/5 to HBBroeker@t-online.de on Fri Oct 13 09:17:54 2017
    Hans - many thanks for the solution of the height of the point. I have, hopefully, found a simpler way without useing a 3 axis
    coordinate system. The height is the first part of the problem however,
    and if the remainder causes trouble, shifting to coordinates may be
    required. If that occurs, your solution will probably be, gratefully,
    applied.

    Hul


    Hans-Bernhard Br?ker <HBBroeker@t-online.de> wrote:
    Am 12.10.2017 um 10:36 schrieb Hul Tytus:

    Given a triangle with the distance of all three sides known

    I'll assume you meant _lengths_ of all three sides.

    and an extra
    point above that triangle with the distance to each of the triangle's points
    known, how is the height of the extra point above the plane of the triangle found?

    In other words, you know the lenghts of all 6 sides of a tetrahedron in
    3D space: AB, BC, AC, AD, BD and CD. Now you want to know one of its 4 heights.

    This looks like there should be a simple solution, but I can't see
    it.

    "Simple" is relative. Without loss of generality you have 6 degrees of freedom for the positions of the 4 vertices of this tetrahedron, in a coordinate system of your own choosing

    A = ( 0, 0, 0)
    B = (xB, 0, 0) | xB > 0
    C = (xC, yC, 0) | yC > 0
    D = (xD, yD, z) | z > 0

    and 6 conditions to impose of them: the six lengths mentioned before:

    AB = xB
    AC^2 = xC^2+yC^2
    BC^2 = (xB-xC)^2 + yC^2
    AD^2 = xD^2 + yD^2 + z^2
    BD^2 = (xD-xB)^2 + yD^2 + z^2
    CD^2 = (xD-xC)^2 + (yD-yC)^2 + z^2

    Now all you have to do is solve this set of equations :-)

    xB = AB is obvious. Subtracting equations 2 and 3 eventually yields:

    BC^2 - AC^2 = AB^2 -2*AB*xC
    xC = (AB^2 - BC^2 + AC^2) / (2 * AB)

    and putting that back into the second equation, you get:

    yC = sqrt(AC^2 -xC^2)

    Subtract equations 4 and 5 to get:

    BD^2 - AD^2 = (xD - AB)^2- xD^2
    = -2*xD*AB + AB^2
    xD = (AB^2 - BD^2 + AD^2) / (2*AB)

    Subtract 5 and 6 to get

    BD^2 - CD^2 = (xD-xB)^2 - (xD-xC)^2 + yD^2 - (yD-yC)^2
    = (xD-xB)^2 - (xD-xC)^2 - 2*yD*yC + yC^2
    yD = (CD^2 - BD^2 + (xD-xB)^2 + (xD-xC)^2 + yC^2) / (2*yC)

    and finally

    z = sqrt(AD^2 - xD^2 - yD^2)

    It may pay off to pass the final results through a numerical solver to
    fight likely rounding errors incurred along the way.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ruben safir@21:1/5 to All on Sat Oct 21 02:23:07 2017
    On 10/12/2017 04:59 PM, Hans-Bernhard Bröker wrote:

    In other words, you know the lenghts of all 6 sides of a tetrahedron in
    3D space: AB, BC, AC, AD, BD and CD.  Now you want to know one of its 4 heights.

    interesting! But this is a 2d problem and it is probably devised to
    determine the right by extrapolating triangles from the know data

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker@21:1/5 to All on Sat Oct 21 13:18:52 2017
    Am 21.10.2017 um 08:23 schrieb ruben safir:
    On 10/12/2017 04:59 PM, Hans-Bernhard Bröker wrote:

    In other words, you know the lenghts of all 6 sides of a tetrahedron in
    3D space: AB, BC, AC, AD, BD and CD.  Now you want to know one of its 4
    heights.

    interesting! But this is a 2d problem

    No, it's not. The words "height ... above the plane" could have clued
    you in that there's clearly a 3rd dimension involved.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)