Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find the barycentric coordinates of a point
ResourceFunction["BarycentricCoordinates"][{p1,p2,…},p] finds the barycentric coordinates of point p in the coordinate system defined by the points pi. |
Find the barycentric coordinates for the point {0.3,0.4} for the coordinate system {{1,1},{-1,1},{0,-1}}:
In[1]:= |
![]() |
Out[3]= |
![]() |
Check the finding:
In[4]:= |
![]() |
Out[4]= |
![]() |
Exact input leads to exact output:
In[5]:= |
![]() |
Out[5]= |
![]() |
BarycentricCoordinates works in 1D:
In[6]:= |
![]() |
Out[6]= |
![]() |
BarycentricCoordinates also works in higher dimensions:
In[7]:= |
![]() |
Out[7]= |
![]() |
BarycentricCoordinates also works in very high dimensions:
In[8]:= |
![]() |
Out[11]= |
![]() |
Check that the barycentric coordinates add up to 1:
In[12]:= |
![]() |
Out[12]= |
![]() |
Recreate the point p and subtract it from the original:
In[13]:= |
![]() |
Out[13]= |
![]() |
The barycentric coordinates add up to 1:
In[14]:= |
![]() |
Out[14]= |
![]() |
Dimensions of the points have to agree with each other:
In[15]:= |
![]() |
Out[15]= |
![]() |
Dimensions of the points have to agree with each other:
In[16]:= |
![]() |
Out[16]= |
![]() |
Interactively move the points of the coordinate system:
In[17]:= |
![]() |
Out[17]= |
![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License