I have a transformation $T \in SE(3)$ parameterized by a mean quaternion $q$ with covariance matrix $\Sigma\_q \in R^{4\times4}$ and a mean translation $t \in R^3$ with covariance matrix $\Sigma\_t \in R^{3\times3}$. 

If I were to transform some point $p\_1 \in R^3$ by $T$, I can easily compute its Euclidean distance to some second point $p\_2 \in R^3$ as $\lVert T p\_1 - p\_2\rVert$. 

What I would like to do instead is incorporate the covariance matrices of my transformation to compute a distance measure similar in function to a Mahalanobis distance. Is there a closed form way to do this?

2D Example
==========

To help clarify, I've plotted the problem in a two dimensional world below, where points are in $R^2$, and transforms are in $SE(2)$. Here, a point $p\_1$ can be transformed by $T$ to find a point $T p\_1$. However, because we know the covariances of the rotation and translation, we can see that random samples of $T p\_1$ would be distributed according to the banana shaped distribution shown in red. What I would like to find then is a distance measure that would will take these covariances into account such that $p\_2$ would be significantly "closer" than $p\_3$ to $T p\_1$.

![2d clarification](https://i.stack.imgur.com/xGg7d.png)