Geometry’s Tools
This page details the tools of geometry useful for Monte Carlo method.
1. In surface ?
In this section, we detail how an point of plan is in geometrical object (square, traingle) of this plan.
1.1. Point in triangle
Set a triangle \(\mathcal{T}\) (origin point \(P\), directional vector \(\mathbf{e_1}\) and \(\mathbf{e_2}\)) and point \(Q\) in plan of the square.
With :
Proof :
We have :
And :
We have an linear equation with two unknowns :
And to have \(Q\) is in \(\mathcal{T}\), we have the condition :
1.2. Point in square
Set a square \(\mathcal{R}\) (origin point \(P\), directional vector \(\mathbf{e_1}\) and \(\mathbf{e_2}\)) and point \(Q\) in plan of the square.
Remark : we can simplifiate the formula to remplace \(||\mathbf{e_1}||\) and \(||\mathbf{e_2}||\) by the side of \(\mathcal{R}\).
Proof :
And we must have the condition : \(0 \leq u \leq 1\) if we want to have \(Q\) in square \(\mathcal{R}\).
It the same for \(v\).
2. Method of Visionaray
This section retake the geometrical method of visionaray.
2.1. Interception by segment
The question is : When the right \(\mathcal{C}\) (of origin \(O\) and of direction \(\mathbf{v}\)) intersect the segment \(\mathcal{Q}\) (of vertex \(A\) and \(B\)) ?
We detail the coordonna :
-
\(A = \begin{pmatrix} x_A \\ y_A \\ z_A \end{pmatrix}\)
-
\(B = \begin{pmatrix} x_B \\ y_B \\ z_B \end{pmatrix}\)
-
\(\mathbf{v} = \begin{pmatrix} x_v \\ y_v \\ z_v \end{pmatrix}\)
We introduce :
-
\(t_1 = \frac{\vec{OA}}{\mathbf{v}}\) (term to term division)
-
\(t_2 = \frac{\vec{OB}}{\mathbf{v}}\)
2.2. Interception by triangle
The question is : When the right \(\mathcal{C}\) (of origin \(O\) and of direction \(\mathbf{v}\)) intersect the triangle \(\mathcal{T}\) (of origin \(P\) and of vector \(\mathbf{e_1}, \mathbf{e_2}\)) ? (we suppose to \(O \notin\) plan of \(\mathcal{T}\))
First, we verify if \(\mathbf{v}\) is parallel of plan of triangle \(\mathcal{T}\) (obviously, if it case, the prolonged right of \(\mathcal{C}\) doesn’t intersect \(\mathcal{T}\)) :
Or, the contraposed :
Remark : \(\left( \mathbf{v} \wedge \mathbf{e_2} \right) \cdot \mathbf{e_1} = \left( \mathbf{v} \wedge \mathbf{e_1} \right) \cdot \mathbf{e_2} \)
We want \(\left( \mathbf{v} \wedge \mathbf{e_2} \right) \cdot \mathbf{e_1} \ne 0\).
Proof : With the rule of calculation of scalar and vectorial produce, we have :
And : \(\mathbf{e_2} \wedge \mathbf{e_1}\) is a normal vector of plan of the triangle \(\mathcal{T}\).
Thus :
After we consider to \(\mathbf{v} \cdot \left( \mathbf{e_2} \wedge \mathbf{e_1} \right) \ne 0\).
Second, we verify if the intersection is in triangle \(\mathcal{T}\)
Proof : We exprim the space :
The intersection is :
We want to manipulate the equation :
In the same way :
Thus, we have the condition :
Recapitulation :
2.3. Interception by parallelogram
We can adapt the recapitulation to have the intersction between right and parallelogram \(\mathcal{R}\) (of origin point \(P\) and directional vector \(\mathbf{e_1}\) and \(\mathbf{e_2}\))
2.4. Interception by plan
Proof : We have
3. Visibility between two plan
Before to calculate the view factor between two surface, we must know if they visible from each one
We must define a oriented surface, what side is emit and absorp of surface.
A oriented surface is a surface (suppose contain in plan), is a surface with an oriented normal.
Set oriented surfaces \(S_1\) and \(S_2\) (with oriented normal : \(\mathbf{n_1}\) and \(\mathbf{n_2}\)) :
5. Detail of Triangle
Thus a triangle \(\mathcal{T}\) of origin point \(P\) and directional vector \(\mathbf{e_1}\) and \(\mathbf{e_2}\).
The center of \(\mathcal{T}\) is \(C = P + \frac{1}{3} \mathbf{e_1} + \frac{1}{3} \mathbf{e_2}\) and the ray of circumscribed circle \(R = ||\vec{CP}|| = \frac{1}{3} || \mathbf{e_1} + \mathbf{e_2}||\)