Discussion:
finding a point
(too old to reply)
Hul Tytus
2017-10-12 08:36:43 UTC
Permalink
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
Hans-Bernhard Bröker
2017-10-12 20:59:33 UTC
Permalink
Post by Hul Tytus
Given a triangle with the distance of all three sides known
I'll assume you meant _lengths_ of all three sides.
Post by Hul Tytus
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.
Post by Hul Tytus
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.
Hul Tytus
2017-10-13 09:17:54 UTC
Permalink
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
Post by Hans-Bernhard Bröker
Post by Hul Tytus
Given a triangle with the distance of all three sides known
I'll assume you meant _lengths_ of all three sides.
Post by Hul Tytus
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.
Post by Hul Tytus
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
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 :-)
BC^2 - AC^2 = AB^2 -2*AB*xC
--> xC = (AB^2 - BC^2 + AC^2) / (2 * AB)
yC = sqrt(AC^2 -xC^2)
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.
ruben safir
2017-10-21 06:23:07 UTC
Permalink
Post by Hans-Bernhard Bröker
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
Hans-Bernhard Bröker
2017-10-21 11:18:52 UTC
Permalink
Post by ruben safir
Post by Hans-Bernhard Bröker
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.

Loading...