tetrahedral interpolation and integration along a segment Let's say we have a several tetrahedrons $T_i$ whose faces touch so that each face belong to two tetrahedrons. Each tetrahedron contain a value $V_{i}$.
Given a position $P$ inside the tetrahedron $T_0$, and neighboring tetrahedron are labeled $T_1, T_2, T_3, T_4$.
How to compute the value $V(P)$ such that its value is a linear interpolation between all $V_i$?
Following this, given a direction $\vec{d}$ and the origin $O$ and a scalar $t$ such that $P(t)=O+d*t$, what is the equation giving the interpolated value along this segment $V(t)$, considering only the part where the segment is inside $T_0$?
I tried to use barycentric coordinates, and I think it confused me more than it helped.
What would be a simple explanation for solving such a problem?
 A: One common method is to assign values to the vertices of your central tetrahedron $T$,
and then use
Barycentric coordinates to interpolate from the vertices of $T$ to any point $p \in T$.
The link shows how to convert between the coordinates of $p$ to its barycentric
coordinates $\lambda_1,\lambda_2,\lambda_3,\lambda_4$. Then use those $\lambda$'s to form a
weighted version of the values at the corners to $T$ to the value at $p$.
To use this approach, you need values at the vertices of $T$. I assume when you say that
each tetrahedron $T_i$ "contains a value" $v_i$, you mean that $v_i$ is somehow appropriate
throughout $T_i$. Then it makes sense to assign to a vertex $u$ of $T$ the average of the
values $v_i$ for the three tetrahedra incident to $u$, and the
value of your central tetrahedron $T$.
To make this calculation less of a heuristic would require explicit criteria
the interpolation is to achieve.
So:


*

*Compute values for the four corners of $T$.

*Compute the barycentric coordinates $\lambda_i$ for $p$. (Requires inverting a $3 \times 3$ matrix.)

*Use the $\lambda$'s to weight the vertex values to an appropriate value for $p \in T$.
