I can describe how I will do it with Dr. Geo, a free interactive geometry software I am developing.
- From the menu Edit>Customise interface, you select the tools you want: select and move, point, circle, segment and macro tools,
Select only the tools you want
- Then you save your empty sketch under the name Minimimal for example,
- Next time you load the Minimal sketch its comes with your customized UI, including the tools to register and play macro-construction.
Geometric canvas with minimal tools
I use this feature to limit the tools used for primary school activities.
In practice, raytracers tend to decompose surfaces into triangular meshes first, because the math needed is so much simpler.
However, you asked how to calculate the intersection between a line and a quadrilateral in 3D, so here goes.
Let's define your ray using an unit vector $\hat{n}$ (unit referring to unit length, $\lvert\hat{n}\rvert=1$) that passes through some point $\vec{p}_0$,
$$\vec{p}_{RAY}(t) = \vec{p}_0 + t\,\hat{n}$$
The quadrilateral is a bit more complicated. Let's say the four corners are $\vec{p}_1$, $\vec{p}_2$, $\vec{p}_3$, and $\vec{p}_1$, with $\vec{p}_1$ and $\vec{p}_4$ diagonally across from each others. We can trace the surface using two variables, $0 \le u, v \le 1$, where $u=0,v=0$ refers to $\vec{p}_1$, $u=1,v=0$ to $\vec{p}_2$, $u=0,v=1$ to $\vec{p}_3$, and $u=1,v=1$ to $\vec{p}_4$, using bilinear interpolation of the coordinates:
$$\vec{p}_{QUAD}(u,v) = \left ( \vec{p}_1 (1-u) + u \vec{p}_2 \right ) (1-v) + v \left ( \vec{p}_3 (1-u) + u \vec{p}_4 \right )$$
which is, after rearranging the terms, the same as
$$\vec{p}_{QUAD}(u,v) = \vec{p}_1 + u \; v \; ( \vec{p}_4 - \vec{p}_3 - \vec{p}_2 + \vec{p}_1 ) + u \; ( \vec{p}_2 - \vec{p}_1 ) + v \; ( \vec{p}_3 - \vec{p}_1 )$$
The intersection is, of course,
$$\vec{p}_{RAY}(t) = \vec{p}_{QUAD}(u,v)$$
In three dimensions, that is actually three equations with three unknowns,
$$\begin{cases}
x_0 + t n_x = x_1 + u \; v \; ( x_4 - x_3 - x_2 + x_1 ) + u \; ( x_2 - x_1 ) + v \; ( x_3 - x_1 ) \\
y_0 + t n_y = y_1 + u \; v \; ( y_4 - y_3 - y_2 + y_1 ) + u \; ( y_2 - y_1 ) + v \; ( y_3 - y_1 ) \\
z_0 + t n_z = z_1 + u \; v \; ( z_4 - z_3 - z_2 + z_1 ) + u \; ( z_2 - z_1 ) + v \; ( z_3 - z_1 )
\end{cases}$$
This can be solved, but the solution contains dozens of terms, and is therefore terribly slow to compute. (I asked Maple for the exact solution. There are two (i.e., $(t_1,u_1,v_1)$ and $(t_2,u_2,v_2)$, but as they don't fit in one screenful, I decided they are way too long to reproduce here.)
Biquadratic and bicubic Bézier surfaces can be solved the exact same way, it's just that there are more terms (up to $u^3$ and $v^3$, and 9 (biquadratic) 16 (bicubic) coordinates per dimension), and thus the result is even more complicated and slow to compute.
Best Answer
Earlier the tetrahedron had 4 points in space.It has a total of 4 planes. After adding an internal point we now have 5 points in the space. If we take any three points we can form a plane. so total planes we can form now with 5 points is 5c3 = 10.
So the number of new planes=10-4=6