We are given a 3D triangle with vertices $(0,0,0), (5,0,10), (0,20,0)$. What is the $z$ value of the point in the triangle with $x=3, y=1$? How do we find the $z$ value?
3D triangle computer graphics
400 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
Intersection of lines and planes: the sides of the triangle T described above can be found as the intersection of 3 lines, which can be found using the formula $$ \frac{x-x_0}{x_1-x_0} = \frac{y-y_0}{y_1-y_0} = \frac{y-y_0}{y_1-y_0} $$ where the line found passes thorough the 2 points $(x_0,y_0,z_0)$ and $(x_1,y_1,z_1)$. After some calculus you find these 3 lines \begin{cases} r: x=y=z\\ s: 1-y=2z-2\\ t: 2-2x=2y+2=2-z\\ \end{cases} Unfortunately the triangle is constrained along the x-axis from $0$ to $1$, along the y-axis from $0$ to $-1$ and along the z-axis from $0$ to $2$, so there is no point belonging to the triangle and at the same time, having the coordinates $(3,1,z)$.
On
As bubba pointed out, your point is outside the triangle. However, let your 3 points be given as $M_1$, $M_2$, and $M_3$. The normal to the plane of your triangle is given by the cross product $N = (M_1 - M_3) \times (M_2 - M_3)$. Compute your plane's offset from the origin$^{[1]}$ as the dot product $D = N \circ M_3$ $^{[2]}$, and your are left with the plane equation, any point $v$ that satisfies $D = N \circ v$ is in the plane.
Now if you are given two values of $v$, you can find the third with the plane equation $D = N \circ v$. But that only guarantees you that you are within the plane of the triangle, not within the triangle itself.
[1] Actually it is the offset scaled by the length of $N$, the true offset is $D / |N|$
[2] Any $M$ will do, as will any point in the plane, not just $M_3$.
There is no such point. All the points of the triangle have $x$ coordinates that are between $0$ and $1$. There is no point with $x=3$.
We could find a point with $x=3$ on the plane containing your three points, but it won't be inside the triangle.