\section{Derivations of $\ddist$}
\label{sec:devD}
%
In this section, we derive of the change rate of intersection distance~$\dist$ in Eq.~\eqref{eqn:rte3d_ind_diff} for \emph{piecewise-planar geometries} (e.g., polygonal meshes) under a few parameterizations.

\paragraph{Translation}
Consider a plane given with normal $\gnorm$ and contains point $\bp$.
Namely, the plane consists of all points $\by \in \Real^3$ satisfying:
%
\begin{equation}
	\langle \gnorm, \by \rangle = \langle \gnorm, \bp \rangle.
\end{equation}
%
Then, substituting $\by$ with the ray equation $\by = \bx - \dist\bom$ gives
%
\begin{equation}
	\langle \gnorm, \bx - \dist\bom \rangle = \langle \gnorm, \bp \rangle,
\end{equation}
%
which in turn leads to
%
\begin{equation}
	\label{eqn:devD:plane_trans_0}
	\dist = \frac{\langle \gnorm, \bx - \bp \rangle}{\langle \gnorm, \bom \rangle}.
\end{equation}
%
Lastly, $\ddist$ can be obtained by differentiating Eq.~\eqref{eqn:devD:plane_trans_0}.
When $\bx$ and $\bom$ are both time-varying,
%
\begin{equation}
	\ddist = \frac{\langle \gnorm, \dbx - \dot{\bp} \rangle \langle \gnorm, \bom \rangle - \langle \gnorm, \bx - \bp \rangle \langle \gnorm, \dbom \rangle}{\langle \gnorm, \bom \rangle^2},
\end{equation}
%
where $\dbx$ and $\dbom$ denotes the time derivative of $\bx$ and $\bom$ (at time $t = 0$).

\paragraph{Linear transformation}
Consider a plane transformed linearly via some matrix~$M(t) \in \Real^{3 \times 3}$ such that $M$ is continuous in $t$ and $M(0)$ equals the identity matrix.
Then, the plane at time $t$ becomes
%
\begin{equation}
	\label{eqn:rte3d_nablaD_plane_linear1}
	\left\{ M(t)\,\by : \gnorm^{\top} \, M^{-1}(t) \, M(t) \, \by = \gnorm^{\top} \, M^{-1}(t) \, M(t) \, \bp \right\}.
\end{equation}
%
Let $\by' := M(t) \, \by$ and $\bm{m} := M^{-\top}(t) \, \gnorm$, Eq.~\eqref{eqn:rte3d_nablaD_plane_linear1} becomes
%
\begin{equation}
	\label{eqn:rte3d_nablaD_plane_linear2}
	\{ \by' : \langle \bm{m}, \by' \rangle = \langle \bm{m}, M(t) \, \bp \rangle \}.
\end{equation}
%
Substituting $\by'$ with the ray equation gives 
%
\begin{equation}
	\langle \bm{m}, \bx - \dist\bom \rangle
	= \langle \bm{m}, \bx \rangle - \langle \bm{m}, \bom \rangle \dist
	= \langle \bm{m}, M(t) \, \bp \rangle.
\end{equation}
%
It follows that
\begin{equation}
	\dist(t) = \frac{\langle \bm{m}, \bx - M(t)\,\bp \rangle}{\langle \bm{m}, \bom \rangle}
	= \frac{\langle \gnorm, M^{-1}(t) \, \bx - \bp \rangle}{\langle \gnorm, M^{-1}(t)\,\bom \rangle}.
\end{equation}
%
Then,
%
\begin{equation}
	\ddist %= \left. \dev\dist \,\right|_{t = 0}
	= \frac{\langle \gnorm, H\bx + \dbx\rangle \langle \gnorm, \bom \rangle - \langle \gnorm, \bx - \bp \rangle \langle \gnorm, H\bom + \dbom\rangle}{\langle \gnorm, \bom \rangle^2},
\end{equation}
%
where $H := \dev(M^{-1})\big|_{t = 0}$.

For instance, \emph{rotations around the $z$-axis} can be modeled as
%
\begin{equation}
	\label{eqn:devD:rotZ_mat}
	M(t) = \begin{pmatrix}
	 	\cos t & -\sin t & 0\\
	 	\sin t & \cos t & 0\\
	 	0 & 0 & 1
 \end{pmatrix}.
\end{equation}
%
Then,
%
\begin{comment}
\begin{equation}
	M^{-1}(t) = M^{\top}(t) = \begin{pmatrix}
		\cos t & \sin t & 0\\
		-\sin t & \cos t & 0\\
		0 & 0 & 1
	\end{pmatrix},
\end{equation}
%
and
\end{comment}
%
\begin{equation}
	H = \left.\frac{\partial M^{-1}}{\partial t}\right|_{t = 0} = \begin{pmatrix}
		0 & 1 & 0\\
		-1 & 0 & 0\\
		0 & 0 & 0
	\end{pmatrix}.
\end{equation}
%
In case of \emph{uniform scaling}, we can use
%
\begin{equation}
	M(t) = \begin{pmatrix}
		\E^t & 0 & 0\\
		0 & \E^t & 0\\
		0 & 0 & \E^t
	\end{pmatrix},
	\quad
	H = \begin{pmatrix}
		-1 & 0 & 0\\
		0 & -1 & 0\\
		0 & 0 & -1
	\end{pmatrix}.
\end{equation}
%
Similarly, for \emph{(nonuniform) scaling along the $x$-axis}, we have
%
\begin{equation}
	M(t) = \begin{pmatrix}
		\E^t & 0 & 0\\
		0 & 1 & 0\\
		0 & 0 & 1
	\end{pmatrix},
	\quad
	H = \begin{pmatrix}
		-1 & 0 & 0\\
		0 & 0 & 0\\
		0 & 0 & 0
	\end{pmatrix}.
\end{equation}

\paragraph{Triangle with moving vertices}
Lastly, we consider the plane determined by a triangle with time-varying vertex locations
%
\begin{equation}
\bp(t) := (\bp_0 + t \velocity_{\bp}), \quad
\bq(t) := (\bq_0 + t \velocity_{\bq}), \quad
\br(t) := (\br_0 + t \velocity_{\br}).
\end{equation}
%
Let $\bm{e}_0 := \bp_0 - \bq_0$, $\bm{e}_1 := \br_0 - \bq_0$, $\Delta\velocity_0 := \velocity_{\bp} - \velocity_{\bq}$, and $\Delta\velocity_1 := \velocity_{\br} - \velocity_{\bq}$.
The plane equation at time $t$ is
%
\begin{equation}
	\label{eqn:devD:tri_vtx_plane}
	\langle \gnorm(t), \by \rangle = \langle \gnorm(t), \bq(t) \rangle,
\end{equation}
%
where $\gnorm(t) = (\bm{e}_0 + t \Delta\velocity_0) \times (\bm{e}_1 + t \Delta\velocity_1)$.
%
Then, substituting $\by$ in Eq.~\eqref{eqn:devD:tri_vtx_plane} with the ray equation $(\bx - \dist\bom)$ yields
%
\begin{equation}
	\dist(t) = \frac{\langle \gnorm(t), \bx - \bq(t) \rangle}{\langle \gnorm(t), \bom \rangle},
\end{equation}
%
and
%
\begin{equation}
	\label{eqn:devD:tri_vtx2}
		\begin{split}
			\ddist %&= \frac{\left.\dev\langle \gnorm(t), \bx - \bq(t) \rangle\right|_{t=0} \langle \gnorm_0, \bom \rangle - \langle \gnorm_0, \Delta\bx \rangle \left.\dev\langle \gnorm(t), \bom \rangle\right|_{t=0}}{\langle \gnorm_0, \bom \rangle^2}\\
			&= \frac{(\langle \dgnorm, \Delta\bx \rangle + \langle \gnorm, \dbx - \velocity_{\bq} \rangle) \langle \gnorm, \bom \rangle - \langle \gnorm, \Delta\bx \rangle \langle \dgnorm, \bom \rangle}{\langle \gnorm, \bom \rangle^2},
		\end{split}
\end{equation}
%
where $\Delta\bx := \bx(0) - \bq_0$, $\gnorm := \gnorm(0) = \bm{e}_0 \times \bm{e}_1$, and
%
$\dgnorm := \dev\gnorm\big|_{t = 0} = \Delta\velocity_0 \times \bm{e}_1 + \bm{e}_0 \times \Delta\velocity_1$.
%
In a special case where only $\bp$ has nonzero velocity (i.e., $\|\velocity_{\bp}\| > 0$ and $\|\velocity_{\bq}\| = \|\velocity_{\br}\| = 0$), Eq.~\eqref{eqn:devD:tri_vtx2} reduces to
%
\begin{equation}
\label{eqn:devD:tri_vtx}
	\ddist = \frac{(\langle \dgnorm, \Delta\bx \rangle + \langle \gnorm, \dbx \rangle) \langle \gnorm, \bom \rangle - \langle \gnorm, \Delta\bx \rangle (\langle \dgnorm, \bom \rangle + \langle \gnorm, \dbom \rangle)}{\langle \gnorm, \bom \rangle^2},
\end{equation}
%
with $\dgnorm = \velocity_{\bp} \times \bm{e}_1$.
