Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

Barycentric Point Location

Express a point as three triangle weights to inspect its location relative to the triangle.

Geometry workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulaWeight A = ((y2-y3)*(x-x3)+(x3-x2)*(y-y3))/((y2-y3)*(x1-x3)+(x3-x2)*(y1-y3)); Weight B = ((y3-y1)*(x-x3)+(x1-x3)*(y-y3))/((y2-y3)*(x1-x3)+(x3-x2)*(y1-y3)); Weight C = 1-(((y2-y3)*(x-x3)+(x3-x2)*(y-y3))/((y2-y3)*(x1-x3)+(x3-x2)*(y1-y3)))-(((y3-y1)*(x-x3)+(x1-x3)*(y-y3))/((y2-y3)*(x1-x3)+(x3-x2)*(y1-y3)))
Sources and model references

Worked example

Inputs

X1
0 length
Y1
0 length
X2
6 length
Y2
0 length
X3
0 length
Y3
6 length
Point x
2 length
Point y
2 length

Expected results

Weight A
0.3333333333 number
Weight B
0.3333333333 number
Weight C
0.3333333333 number

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Enter the labeled inputs using consistent units.
  2. Check the stated assumptions and calculate.
  3. Review each output and compare another input scenario.

Try this example

{
  "x1": 0,
  "y1": 0,
  "x2": 6,
  "y2": 0,
  "x3": 0,
  "y3": 6,
  "x": 2,
  "y": 2
}

Accuracy and scope

Nonnegative weights indicate a point inside or on the triangle. Finite floating-point arithmetic; results can lose precision near singular or extreme inputs.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.