5
$\begingroup$

For example if I have a point $(\alpha_1,\alpha_2,\alpha_3,\alpha_4)$ and a polygon with vertices $v_1,v_2,v_3,v_4$, can I determine the actual location without calculating the result with the formula ($\sum_i\alpha_i\times v_i$) but just using a ruler and line intersections?

I was thinking of a step by step approach like how the center of mass of a triangle can be determined by taking the midpoint of each side and drawing a line to the opposite vertex, but I can't seem to generalize it properly to work with an arbitrary number of vertices and different weights per vertex.

The only way that I could think of is to measure the segment on each side and "shift" each segment so it lies one after another, essentially doing vector addition, but the errors add up due to inaccuracies.

Thanks in advance!

Edit: After rereading a few times and trying out some things I can see why it might be ambiguous, so let me try to clarify: I have an equation $\alpha_0 \times v_0 + \alpha_1 \times v_1 + ... + \alpha_n \times v_n$ with $\sum_i \alpha_i = 1$. I can rewrite that as

$\alpha_1 \times (v_1-v_0) + \alpha_2 \times (v_2-v_0) + ... + \alpha_n \times (v_n - v_0) + 1 \times v_0$ with the coefficient of $v_0$ equal to 1 because it's corresponds to the sum of all $\alpha$.

Now if I draw each term as a vector starting from $v_0$ for a random polygon and semi random weights I get the following image:

http://i.imgur.com/dyVGCHi.png (can't embed image due to not enough reputation, sorry)
[ Maybe not, but I have so I will lend you a hand (HdB) ]
enter image description here
To get the corresponding point from the barycentric coordinates $(\alpha_0, ..., \alpha_n)$ I now just need to do vector addition, as shown in green.

With a lot of vertices this gets quite inaccurate due to having to shift a ruler to determine the next point until the entire sum is done, so my question was if there was any way to determine the same point without adding up all those inaccuracies?

$\endgroup$
  • $\begingroup$ To clarify, are you looking for a way to find the barycentric co-ordinates of a four sided polygon geometrically? $\endgroup$ – Guy Paterson-Jones Oct 31 '16 at 7:47
  • $\begingroup$ @GuyPaterson-Jones The other way around. I have the barycentric coordinates and want to determine the location of the point on paper. Like on a line it's a simple interpolation between 2 points, in a triangle it's like determining the center of mass. I am unsure how the method works for more than 3 vertices. $\endgroup$ – drake7707 Oct 31 '16 at 9:56
  • $\begingroup$ How are the $\alpha_i$ defined? $\endgroup$ – Han de Bruijn Oct 31 '16 at 12:28
  • $\begingroup$ @HandeBruijn Please see my edit, hopefully this will clarify a few things. $\endgroup$ – drake7707 Nov 1 '16 at 8:01
  • $\begingroup$ note that in 2D, barycentric coordinates with more than $3$ components will not define a point bi-univocally. $\endgroup$ – G Cab Nov 1 '16 at 16:31
3
+100
$\begingroup$

It is my personal opinion that the vector addition the OP is unsatisfied with can not be significantly improved. So what follows here is not really an answer but rather some comments.
What's confusing in the first place is the phrase barycentric coordinates in the title. As has become clear from the context, coordinates of the barycenter are meant instead, but the terminology and the description in the tag (barycentric-coordinates) is somehow confusing indeed, therefore I think the OP is not to be blamed for this.
If attention is restricted to a triangle, and if it is assumed that all weights $\alpha$ are equal, then three cases can be distinguished:

  1. Vertex Barycenter: $\vec{v}_Z = \left(\vec{v}_1 + \vec{v}_2 + \vec{v}_3\right)/3$
  2. Area Barycenter: $\vec{v}_A = \iint_\Delta \vec{v}(x,y)\,dx\,dy\, / \iint_\Delta dx\,dy$
  3. Edge Barycenter: $\vec{v}_E = \oint_\Delta \vec{v}(t)\left|\dot{\vec{v}}(t)\right| dt / \oint_\Delta \left|\dot{\vec{v}}(t)\right| dt$
Working out for the Area Barycenter - and the $(\xi,\eta)$ employed here are really, really barycentric coordinates: $$\vec{v}(\xi,\eta) = \vec{v}_1 + (\vec{v}_2-\vec{v}_1)\xi+(\vec{v}_3-\vec{v}_1)\eta \\ \Longleftrightarrow \quad \begin{cases} x = x_1+(x_2-x_1)\xi+(x_3-x_1)\eta\\y = y_1+(y_2-y_1)\xi+(y_3-y_1)\eta\end{cases} $$ Giving: $$ \vec{v}_A = \frac{ \vec{v}_1\Delta\iint d\xi\,d\eta + (\vec{v}_2-\vec{v}_1)\Delta\iint\xi\,d\xi\,d\eta + (\vec{v}_3-\vec{v}_1)\Delta\iint\eta\,d\xi\,d\eta }{\Delta\iint d\xi\,d\eta} $$ with Jacobian $$ \Delta = \operatorname{det}(\vec{v}_2-\vec{v}_1,\vec{v}_3-\vec{v}_1) = \begin{vmatrix} x_2-x_1 & x_3-x_1 \\ y_2-y_1 & y_3-y_1\end{vmatrix} $$ and $$ \iint\xi\,d\xi\,d\eta = \int_0^1\left[\int_0^{1-\xi} d\eta\right]\xi\,d\xi = \int_0^1 (1-\xi)\xi\,d\xi = \frac{1}{6}\\ \iint\eta\,d\xi\,d\eta = \int_0^1\left[\int_0^{1-\xi} \eta d\eta\right]\,d\xi = \int_0^1 (1-\xi)^2/2\,d\xi = \frac{1}{6}\\ \iint d\xi\,d\eta = \int_0^1\left[\int_0^{1-\xi} d\eta\right] d\xi = \int_0^1 (1-\xi) d\xi = \frac{1}{2} $$ Finally resulting in: $$ \vec{v}_A = \frac{\vec{v}_1\Delta/2 + (\vec{v}_2-\vec{v}_1)\Delta/6 + (\vec{v}_3-\vec{v}_1)\Delta/6}{\Delta/2} = \left(\vec{v}_1 + \vec{v}_2 + \vec{v}_3\right)/3 = \vec{v}_Z $$ Which is, entirely by "coincidence", exactly the same expression as with the Vertex Barycenter (assuming that coincidence is something that does exist in mathematics, which I don't believe). Anyway, the equivalence between Vertex Barycenter and the Area Barycenter explains why it is possible to find the former with a construct that belongs to the latter, namely, as it is formulated in the question: by taking the midpoint of each side and drawing a line to the opposite vertex. Indeed, because then we have subdivided the triangle in two balanced equal areas each time.

For the sake of completeness, we shall work out the last case too, for the Edge Barycenter $\vec{v}(t) = \vec{v}_a(t)\cup\vec{v}_b(t)\cup\vec{v}_c(t)$ , where: $$\begin{cases} \vec{v}_a(t) = \vec{v}_2 + \left(\vec{v}_3-\vec{v}_2\right)t \\ \vec{v}_b(t) = \vec{v}_3 + \left(\vec{v}_1-\vec{v}_3\right)t \\ \vec{v}_c(t) = \vec{v}_1 + \left(\vec{v}_2-\vec{v}_1\right)t \end{cases} \quad \mbox{with} \quad 0 \le t \le 1 $$ Resulting in: $$ \vec{v}_E = \frac{\left|\vec{v}_3-\vec{v}_2\right|\left(\vec{v}_3+\vec{v}_2\right)/2 +\left|\vec{v}_1-\vec{v}_3\right|\left(\vec{v}_1+\vec{v}_3\right)/2 +\left|\vec{v}_2-\vec{v}_1\right|\left(\vec{v}_2+\vec{v}_1\right)/2}{ \left|\vec{v}_3-\vec{v}_2\right|+\left|\vec{v}_1-\vec{v}_3\right|+\left|\vec{v}_2-\vec{v}_1\right|} $$ It is noticed that this is only equ(iv)al(ent) with the Vertex Barycenter if the lengths of the three edges of the triangle are all equal, such in sharp contrast with the Area Barycenter result.

EDIT. The following is from the Wikipedia article about Quadrilaterals:
The "vertex centroid" is the intersection of the two bimedians. As with any polygon, the $x$ and $y$ coordinates of the vertex centroid are the arithmetic means of the $x$ and $y$ coordinates of the vertices.
The "area centroid" of quadrilateral ABCD can be constructed in the following way. Let Ga, Gb, Gc, Gd be the centroids of triangles BCD, ACD, ABD, ABC respectively. Then the "area centroid" is the intersection of the lines GaGc and GbGd.
It is thus confirmed that the Vertex Barycenter and the Area Barycenter, quite in general, are not the same for quadrilaterals. And likewise their geometrical construction.
Last but not least. The area centroid is not at all linear in the vertex coordinates for an arbitrary (convex) polygon, not even for an arbitrary (convex) quadrilateral:

Thus, in general : $\vec{v}_A \ne \alpha_1 \vec{v}_1 + \alpha_2 \vec{v}_2 + \alpha_3 \vec{v}_3 + \alpha_4 \vec{v}_4$ .

$\endgroup$
1
$\begingroup$

Observe that finding the weighted average of $v_1,\ldots,v_n$ with weights $\alpha_1,\ldots,\alpha_n$ is the same as

  1. finding the weighted average $\bar v_{1,\ldots,n-1}$ of $v_1,\ldots,v_{n-1}$ with weights $\alpha_1,\ldots,\alpha_{n-1}$, then
  2. finding the weighted average of $\bar v_{1,\ldots,n-1}$ and $v_n$ with weights $\alpha_1+\cdots+\alpha_{n-1}$ and $\alpha_n$.

This recursively expands to $n-1$ weighted averages each involving only two points at a time.

So you only need to have one geometric construction (i.e. finding the weighted average of two points, i.e. dividing the line segment $v_1v_2$ in the ratio $\alpha_2:\alpha_1$) and apply it recursively.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.