2

Whenever we define the trilinear coordinates or the barycentric coordinates of a point in $\mathbb R^2$, it is with reference to some fixed triangle.

Do we know how the coordinates behave when we change the reference triangle?

chhro
  • 2,226
  • 8
  • 14

2 Answers2

2

Do we know how the coordinates behave when we change the reference triangle?

Yes, we do.

Both trilinear and barycentric coordinates are essentially homogeneous coordinates, which makes projective geometry the tool describing them. A change of projective basis corresponds to projective transformation, which you can express as multiplication by a $3\times3$ matrix. As I described in another answer, such a projective transformation is uniquely determined by four points and their images.

Another useful concept is the duality between points and lines in projective geometry. Essentially you can consistently swap the roles of points and lines and statements using only these concepts remain valid. With transformation added to the mix, a transformation operating on a line is described by the inverse transpose of the matrix for the operation on points.

Taking these two together, a change of basis can just as well be described as a transformation mapping four given lines to their images. So if you have the coordinates of the edges (which you can compute from those of the corners using cross products) of the second triangle, expressed in barycentric coordinates of the first triangle, you can add the line at infinity as a fourth line both as the preimage and as the image, and then deduce the transformation from that. The line at infinity in barycentric coordinates has the equation $x+y+z=0$.

Wikipedia tells you that trilinear coordinates $[x:y:z]$ correspond to barycentric coordinates $[ax:by:cz]$. This is a multiplication by a diagonal matrix, so it fits the general framework of projective transformations. You can use this either to express the line at infinity in trilinear coordinates, or to change from trilinear coordinates to barycentric, do the conversion there using the line at infinity as described above, then convert back. Either way make sure to use the edge length of the appropriate triangle at each step.

If you don't know the coordinates of one triangle in the reference frame of the other, or of both triangles with respect to some common third frame of reference, then in general converting from one to the other will not be possible. You need some information.

MvG
  • 42,596
  • Appreciate the response, wasn't really expecting an answer as the question is kind of vague. I came across this question in the context of three triangles with a common side and a point in the intersection of the three. So I want to know how the trilinear/barycentric coordinates change in such a configuration. – chhro Feb 26 '19 at 21:40
  • I have given a concrete example on a certain change of coordinates that might interest you. – Jean Marie Feb 27 '19 at 00:15
2

A concrete example that can help to understand a certain correspondence for a same affine transform presented either with affine coordinates or barycentric coordinates [I used to present this example some years ago in a lecture I delivered on the introduction to projective geometry]. A similar example could be given with trilinear coordinates.

Let us consider the affine transform whose effect can be seen on Fig. 1 : it sends the left giraffe onto the right giraffe, and as well transforms points $A,B,C,D,E$ into points $A',B',C',D',E'$ resp.

enter image description here

Fig. 1 : On the left, a giraffe grazing a shrub under the Sun. On the right, transformed girafe + shrub + Sun (mirage ?).

If we take axes with center $C$ and basis vectors $\vec{CA}$ and $\vec{CB}$, the affine transformation with respect to this affine coordinate system is as follows :

$$\binom{x'}{y'}=\begin{pmatrix}0.5&-0.5\\0.5& \ 0.5\end{pmatrix}\binom{x}{y}+\binom{1}{0}\tag{1}$$

(very intuitively, and somewhat falsely, a rotation + homothety + translation effect).

Relationship (1) can be written with a single matrix under the form

$$\begin{pmatrix}x'\\y'\\1\end{pmatrix}=\underbrace{\begin{pmatrix}0.5&-0.5&1\\0.5& \ 0.5 &0\\0&0&1\end{pmatrix}}_{M_{aff}}\begin{pmatrix}x\\y\\1\end{pmatrix}\tag{2}$$

(index $aff$ in $M_{aff}$ is to remember that it is a representation with respect to affine coordinates.)

Now, the matrix of the same transformation with respect to barycentric coordinates $a,b,c$ (where the reference triangle is $ABC$ and with normalization $a+b+c=1$) :

$$\begin{pmatrix}a'\\b'\\c'\end{pmatrix}=\underbrace{\begin{pmatrix}1.5&0.5&1\\0.5& \ 0.5 &0\\-1&0&0\end{pmatrix}}_{M_{bar}}\begin{pmatrix}a\\b\\c\end{pmatrix}.\tag{3}$$

Explanation : quite naturally, the columns of $M_{bar}$ are the barycentric coordinates of points $A'$, $B'$, $C'$ resp. with resp. to base points $A,B,C$.

The correspondence between $M_{aff}$ and $M_{bar}$ can be shown to be this one :

$$M_{bar}=J^{-1}M_{aff}J$$

$$\text{with} \ J:=\begin{pmatrix}1&0&0\\0&1 &0\\1&1&1\end{pmatrix} \ \text{and} \ J^{-1}=\begin{pmatrix}1&0&0\\0&1 &0\\-1&-1&1\end{pmatrix}.$$

Exercices :

1) One sees on Fig. 1 that $D$ is a fixed ("eigen" ?) point of this transformation. Check it.

2) Explain the roles of $J$ and its inverse as translators between barycentric and cartesian coordinates.

Jean Marie
  • 81,803
  • Very nice answer. Both the answers were informative in this question. I wonder why none of them were upvoted. –  Jul 24 '19 at 16:19
  • 1
    @Shashwat Asthana Thanks. It is a kind of explanation I had a pleasure to write because I believe it enlightens correpondences between cousin geometries (I haven't found such an example in the litterature). – Jean Marie Jul 25 '19 at 07:25
  • 1
    Can you clear another doubt of mine in PG? It's not really a general doubt. Consider PG(2,R) (if that's not a standard notation, it means a 2 dimensional projective geo on the field of real numers), how are we supposed to think of triangle centers? For example, if I were to perform a projective transformation taking three vertices of a triangle to (1,0,0),(0,1,0) and (0,0,1), will the centroid of the original triangle be transformed to the centroid of our new triangle? –  Jul 26 '19 at 12:02
  • 1
    Wait, I'll ask a question. You can answer their. I might get even more interesting answers. –  Jul 26 '19 at 12:52
  • 1
    No, the image of the centroid $G$ of 3 points $A,B,C$ is the centroid $G'$ of images $A',B',C'$ only for the very particular case of affine transforms. Take for example transformation $x'=x/(x+y), y'=2*y/(x+y)$ and $A=(1,0), B=(0,1)$ and $C=(1,1)$ : $G=(1/2,1)$, $G'=(1/2,1)$ whereas the image of $G$ is $(1/3,4/3)$. – Jean Marie Jul 26 '19 at 12:54