Description
Map three supplied barycentric weights summing to one to a planar triangle point; weights may be negative, no inside-triangle claim.
Planar geometry operates on two-coordinate Cartesian points and explicit shape boundaries. A closed rectangle includes its edges, while a segment parameter locates a point along a supporting line. Signed cross products, areas and axis gaps preserve orientation or direction information that a magnitude alone would lose.
Map three supplied barycentric weights summing to one to a planar triangle point; weights may be negative, no inside-triangle claim.
When to use this tool
Use this tool to map three supplied barycentric weights summing to one to a planar triangle point; weights may be negative, no inside-triangle claim.
How to use the tool and how it works
- Enter vertices, weights using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.point. Interpret signs, units, ordering and null values using the rules below.
Require exactly three planar vertices and weights with |sum−1| < 10⁻¹². Return the coordinatewise weighted sum of the three vertices in their supplied order.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| vertices | Exactly three planar vertices [[Ax,Ay],[Bx,By],[Cx,Cy]] in weight order. | Dense list of at most 128 rows of at most 128 finite numbers; the operation’s shape constraints also apply. |
| weights | Three dimensionless barycentric weights in the supplied vertex order. | Dense list of at most 128 finite numbers, subject to the stated integer/shape rules. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.point | Resulting planar [x,y] point in coordinate units. |
{
"input": {
"vertices": [
[
0,
0
],
[
2,
0
],
[
0,
2
]
],
"weights": [
0.5,
0.25,
0.25
]
},
"output": {
"result": {
"point": [
0.5,
0.5
]
}
}
} Limitations and assumptions
- Weights may be negative, and triangle degeneracy is not rejected by this forward weighted sum.
- Point components and rectangle bounds are finite within ±1,000,000,000. Rectangles use [minX,minY,maxX,maxY] with ordered inclusive bounds. Floating arithmetic is used without an implicit robustness tolerance.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Choose the boundary and coordinate convention explicitly. Use robust geometric predicates or a topology-aware library when near-coincidence, holes, invalid polygons or geographic coordinates matter.
References
Similar or alternative tools
- Triangle Point Barycentric Coordinates
Invert planar barycentric coordinates on a nondegenerate supplied triangle; floating arithmetic and signed exterior weights are retained.
- Triangle Barycentric Membership
Audit supplied three-coordinate barycentric closed-triangle membership with an explicit nonnegative absolute tolerance; does not validate a triangle’s geometry.