6

The question is specifically about linear Interpolation, which is usually defined to be a function $$ f : V \times V \times \mathbb{R} \rightarrow V \\ f(v_0,v_1,\alpha) = v_0 + (v_1-v_0) \cdot \alpha $$ So it takes the arguments $v_0$ and $v_1$ and a real value $\alpha$ (often, but not necessarily, in $[0,1]$), and computes the linearly interpolated value.

Conversely, there may be a function like this: $$ g : V \times V \times V \rightarrow \mathbb{R} \\ g(v_0,v,v_1) = (v - v_0) / (v_1 - v_0) $$ For the given arguments, it computes the "relative position" of one element between the others - namely, the value that could be used as the $\alpha$ value in the interpolation function, so that $f(v_0, v_1, g(v_0, v, v_1)) = v$.

It's not an "inverse", and the term "opposite" in the title was just for lack of a better term. Right now, I'm calling it ~"interpolation parameter function", but I wonder whether there is a commonly used term for that.

Marco13
  • 2,083
  • I don't feel confident that this is the best description, and it probably couldn't be used without explanation, but I might describe that as a barycentric coordinate. Edit: wait, I assumed $v$ had to be on the line containing the other two (the affine span of them). – Mark S. Mar 13 '19 at 21:11
  • 2
    It is in fact an inverse after you "curry" your functions in the right way. Namely $g(v_0,\cdot,v_1)$ is an inverse of $f(v_0,v_1,\cdot)$. – Ian Mar 13 '19 at 21:12
  • @MarkS. That's indeed pretty close already (and I wonder why I didn't think of this yet). The fact that barycentric coordinates are mainly interpreted geometrically means that it does not fit perfectly in the most generic sense, but if nobody posts a better answer in the next days, I'd probably ping you to turn the comment into an answer and accept it as being "as close as it gets". – Marco13 Mar 13 '19 at 21:22
  • @Ian Yes, it can be boiled down to an inverse, but would require an additional description then - basically, some "verbal un-currying". Just calling it the "inverse of the interpolation" would not be sufficient, I guess... – Marco13 Mar 13 '19 at 21:23
  • @MarkS. Regarding the edit: I don't think that being contained in the simplex is a necessary condition for computing the barycentric coordinates, so this should not be a problem. – Marco13 Mar 13 '19 at 21:25
  • @Marco13 I agree; it doesn't have to be in the simplex (the convex hull), but it has to be in the line (the affine hull/span). Since your domain of $g$ was written as $V\times V\times V$, I wasn't certain if you intended for $v$ to lie on the line containing $v_0$ and $v_1$. – Mark S. Mar 13 '19 at 23:20
  • @MarkS. If I understood correctly, then this would just be the the difference of $\alpha$ either being in $[0,1]$ (convex hull) or in $\mathbb{R}$ (affine space). If so, maybe I should have omitted the "$[0,1]$" part in the question. – Marco13 Mar 14 '19 at 01:27
  • Sorry, I'm not being clear because I wanted avoid assumptions. I think we both agree on what you want $g$ to do and how the phrase "barycentric coordinates" is often used. But you have a typo in the question since if $V$ is more than one dimensional, then either $g$ is a partial function, or you don't actually want the middle component of the domain "$V\times V\times V$" to be all of $V$. – Mark S. Mar 14 '19 at 01:34
  • @MarkS. Ok, although I usually try to be precise, I might not have been precise enough here. I think that you (roughly) referred to the point that $v$ must be an affine combination of $v_0$ and $v_1$ in the first place. E.g. if $V = \mathbb{R}^3$, and $v_0 = (0,0,1)$, $v_1 = (0,1,0)$ then there would be no solution for $v = (1,0,0)$. (I'll think about how to describe it more clearly, although this might be a case where attempting to be more (formally) precise might distract from the point of the question...) – Marco13 Mar 14 '19 at 15:15
  • @MarkS. As mentioned above: Barycentric coordinates seems to be as close as it gets to a sensible word for this. If you wrote an answer (probably mentioning the constraint that $v$ must be an affine combination of $v_0$ and $v_1$ etc), I'd accept it, otherwise, I'd self-answer it, referring to your comment. – Marco13 Mar 19 '19 at 20:38

1 Answers1

1

As in the question, given a real vector space $V$, we can define a function for parametrizing lines between vectors by $$ f : V \times V \times \mathbb{R} \rightarrow V \\ f(\mathbf v_0,\mathbf v_1,\alpha) = \mathbf v_0 + (\mathbf v_1-\mathbf v_0) \cdot \alpha\text{.} $$

If $\mathbf v_0\ne\mathbf v_1$, then $\alpha\mapsto f(\mathbf v_0,\mathbf v_1,\alpha)$ certainly defines an injective function $\mathbb R\to V$, with image line $\overleftrightarrow{\mathbf v_0\mathbf v_1}$. Thus, we can define a bijective function $F_{\mathbf v_0,\mathbf v_1}:\mathbb R\to \overleftrightarrow{\mathbf v_0\mathbf v_1}$.

The inverse is given by $F_{\mathbf v_0,\mathbf v_1}^{-1}:\mathbf v\mapsto\dfrac{\mathbf v-\mathbf v_0}{\mathbf v_1-\mathbf v_0}$, where the division is to be interpreted as yielding the relevant scalar multiple, as mentioned in this MSE answer. This inverse could be described as providing the barycentric coordinate for the input point on the line $\overleftrightarrow{\mathbf v_0\mathbf v_1}$ with respect to the affine basis $(\mathbf v_0,\mathbf v_1)$.


As alluded to in the original post, we could combine these inverses together as a single function, though writing the domain properly is a bit cumbersome. We could define $$g:\left\{(\mathbf v_0,\mathbf v,\mathbf v_1)\left|\mathbf v_0\ne\mathbf v_1\text{ and } \mathbf v\in\overleftrightarrow{\mathbf v_0\mathbf v_1}\right.\right\}\to \mathbb R$$ $$g(\mathbf v_0,\mathbf v,\mathbf v_1)= F_{\mathbf v_0,\mathbf v_1}^{-1}(\mathbf v)\text{.}$$

Mark S.
  • 25,893