@@ -975,12 +975,12 @@ As before we align one of the simplices to the reference simplex with vertices a
...
@@ -975,12 +975,12 @@ As before we align one of the simplices to the reference simplex with vertices a
A vertex of $X$, $\vec{x}_i$, lies inside $Y$ only if $\vec{x}_i \cdot\vec{e}_\gamma\geq0$ for all $\gamma$.
A vertex of $X$, $\vec{x}_i$, lies inside $Y$ only if $\vec{x}_i \cdot\vec{e}_\gamma\geq0$ for all $\gamma$.
It is also necessary that $1-\vec{x}_i \cdot\vec{1}\geq0$, where $\vec{1}=\sum\vec{e}_\gamma$.
It is also necessary that $1-\vec{x}_i \cdot\vec{1}\geq0$, where $\vec{1}=\sum\vec{e}_\gamma$.
For the sake of notation we denote $\vec{x}_i\cdot\vec{e}_0=1-\vec{x}_i\cdot\vec{1}$.
For the sake of notation we denote $\vec{x}\cdot\vec{e}_0=1-\vec{x}\cdot\vec{1}$.
The $(ij)$--th edge of $X$ intersects an $(n-1)$--dimensional hyperplane of $Y$, defined as $P_\gamma=\Set{\vec{x}\in\bbr^n}{\vec{x}\cdot\vec{e}_\gamma=\delta_0}$ or $P_0=\Set{\vec{x}\in\bbr}{\vec{x}\cdot\vec{1}=1}$, if $\sign(\vec{x}_i \cdot\vec{e}_\gamma)\neq\sign(\vec{x}_j \cdot\vec{e}_\gamma)$.
The $(ij)$--th edge of $X$ intersects an $(n-1)$--dimensional hyperplane of $Y$, defined as $P_\gamma=\Set{\vec{x}\in\bbr^n}{\vec{x}\cdot\vec{e}_\gamma=0}$, if $\sign(\vec{x}_i \cdot\vec{e}_\gamma)\neq\sign(\vec{x}_j \cdot\vec{e}_\gamma)$.
Proposition \ref{prop:tetra intersections} can be extended to this general dimension.
Proposition \ref{prop:tetra intersections} can be extended to this general dimension.
\begin{prop}
\begin{prop}\label{prop:gen}
Let $X$ be an $n$--simplex intersecting an $(n-1)$--hyperplane $P$.
Let $X$ be an $n$--simplex intersecting an $(n-1)$--hyperplane $P$.
At least $n$ edges of $X$ intersect $P$.
At least $n$ edges of $X$ intersect $P$.
At most $\lceil{(n+1)/2}\rceil\lfloor{(n+1)/2}\rfloor$ edges of $X$ intersect $P$.
At most $\lceil{(n+1)/2}\rceil\lfloor{(n+1)/2}\rfloor$ edges of $X$ intersect $P$.
...
@@ -1007,6 +1007,9 @@ As it is assumed that $X$ intersects $P$ it must be that the number of edges tha
...
@@ -1007,6 +1007,9 @@ As it is assumed that $X$ intersects $P$ it must be that the number of edges tha
\end{table}
\end{table}
\end{proof}
\end{proof}
By Proposition \ref{prop:gen} the intersection between an $n$--simplex and an $(n-1)$--hyperplane is either an $(n-1)$--simplex embedded in an $(n-1)$--hyperplane or may be expressed as a triangulation of such simplices.
By induction each step in the algorithm computes the intersection between two objects of appropriate dimension.
Suppose we are $m$ steps through this algorithm and we are considering the intersection between the $(m-1)$--dimensional hyperplane defined by $m$ vertices of $X$ and the $(n-m)$--dimensional hyperplane defined by $m$$(n-1)$--dimensional hyperplanes $P_\gamma$.
Suppose we are $m$ steps through this algorithm and we are considering the intersection between the $(m-1)$--dimensional hyperplane defined by $m$ vertices of $X$ and the $(n-m)$--dimensional hyperplane defined by $m$$(n-1)$--dimensional hyperplanes $P_\gamma$.
\begin{lemma}
\begin{lemma}
...
@@ -1081,19 +1084,50 @@ That is, $\vec{h}(J | \Gamma)$ lies on $Y$ if and only if $\vec{h}(J | \Gamma) \
...
@@ -1081,19 +1084,50 @@ That is, $\vec{h}(J | \Gamma)$ lies on $Y$ if and only if $\vec{h}(J | \Gamma) \
Only the sign of $\vec{h}(J | \Gamma)\cdot\vec{e}_0$ is needed for this determination as the position of $\vec{h}(J | \Gamma)$ is calculated via the other scalar products.
Only the sign of $\vec{h}(J | \Gamma)\cdot\vec{e}_0$ is needed for this determination as the position of $\vec{h}(J | \Gamma)$ is calculated via the other scalar products.
\begin{cor}
\begin{cor}
The numerator of $\vec{h}(J | \Gamma_i)\cdot\vec{e}_{\eta_i}$ is shared with the numerators of $\vec{h}(J | \Gamma_j)\cdot\vec{e}_{\eta_j}$ for $m$ values of $j$, up to a change in sign, where $\Gamma_i$ and $\Gamma_j$ have cardinality $m$.
The numerator of $\vec{h}(J | \Gamma)\cdot\vec{e}_{\eta}$ is shared with the numerators of $\vec{h}(J | \Gamma_j)\cdot\vec{e}_{j}$ for $m$ values of $j$, up to a change in sign, where $\Gamma$ and $\Gamma_j$ have cardinality $m$.
Since $\Gamma_i$ has $m$ elements there are $m$ such $\Gamma_j$.
Since $\Gamma$ has $m$ elements there are $m$ such $\Gamma_j$.
For each of these the numerator of $\vec{h}(J | \Gamma_j)\cdot\vec{e}_j$ is the same up to an exchange of columns in the determinant.
For each of these the numerator of $\vec{h}(J | \Gamma_j)\cdot\vec{e}_j$ is the same up to an exchange of columns in the determinant.
\end{proof}
\end{proof}
By this corollary, if there is a change in sign of $\vec{h}(J | \Gamma)\cdot\vec{e}_\eta$ then the entire $m$--face of $X$ defined by the indices $J$ ends up on the other side of the $(n-m)$--face of $Y$ defined by $\Gamma\cup\set{\eta}$.
By this corollary, if there is a change in sign of $\vec{h}(J | \Gamma)\cdot\vec{e}_\eta$ then the entire $m$--face of $X$ defined by the indices $J$ ends up on the other side of the $(n-m)$--face of $Y$ defined by $\Gamma\cup\set{\eta}$.
If the $J$--th $m$--face of $X$ does not have $m+1$ intersections then the signs of all existing intersections can be found using the intersections of the $(m-1)$--faces of $X$ with indices that are subsets of $J$.
If the $J$--th $m$--face of $X$ does not have $m+1$ intersections then the signs of all existing intersections can be found using the intersections of the $(m-1)$--faces of $X$ with indices that are subsets of $J$.
\subsection{Algorithm for the intersection of n-dimensional simplices}
Let $[a..b]$ represent the set of integers between $a$ and $b$.
\begin{description}
\item[Step 1: Change of coordinates.] Find an affine transformation such that the $n+1$ vertices of $V$ are mapped to the origin and $\vec{e}_j$ for $j=1, \dots, n$.
Use this transformation to map $U$ to the simplex $X$.
\item[Step 2: Vertices of $X$ in $Y$.] Calculate and store the values of $p_{i,j}=\vec{e}_j \cdot\vec{x}_i$ for $i,j=0,\dots, n$.
If $p_{i,j}$ is non-negative for all $j$ then the $i$--th vertex of $X$ lies in $Y$, and by extension the $i$--th vertex of $U$ lies in $V$.
\item[Step 3: Edges of $X$ with planes of $Y$.] For each $j$ compare all pairs of $p_{i,j}$.
If $\sign(p_{i,j})\neq\sign(p_{k,j})$ then calculate $\vec{h}(\set{i,k} | \set{j})\cdot\vec{e}_\gamma$ for all $\gamma\neq j$.
If this value is non-negative for all $\gamma$ then the intersection $\vec{h}(\set{i,k} | \set{j})$ lies on $Y$ and forms part of the polyhedron of intersection $Z$.
\item[Step m: Repeat $n-1$ times.] For each pair $\vec{h}(J \setminus\set{i} | \Gamma)\cdot\vec{e}_\gamma$ and $\vec{h}(J \setminus\set{k} | \Gamma)\cdot\vec{e}_\gamma$ with different sign calculate $\vec{h}(J | \Gamma\cup\set{\gamma})\cdot\vec{e}_\eta$ for all $\eta\notin\Gamma\cup\set{\gamma}$.
If it is positive for all such $\eta$ then the intersection $\vec{h}(J | \Gamma\cup\set{\gamma})$ lies on $Y$ and forms part of $Z$.
\item[Step end: Vertices of $Y$ in $X$.] If $\vec{h}([0..n]\setminus\set{i} | [0..n]\setminus\set{\eta, \gamma})\cdot\vec{e}_\gamma$ has different sign than $\vec{h}([0..n]\setminus\set{k} | [0..n]\setminus\set{\eta,\gamma})\cdot\vec{e}_\gamma$ then the vertex of $Y$ at $\vec{e}_\eta$ lies inside $X$ and is therefore a part of $Z$.
If $\eta=0$ then the vertex at the origin lies inside $X$.
\end{description}
\begin{thm}
This algorithm is consistent.
\end{thm}
\begin{proof}
Outline:
\begin{itemize}
\item Prove each step of the algorithm is self-consistent;
\item Prove each step is consistent with the previous step;