# BarycentricInterpolate

> Interpolates between three vertices using barycentric weights, writing into result a vertex at an arbitrary point inside (or outside) the triangle they form.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.6/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## BarycentricInterpolate(Vertex, Vertex, Vertex, float, float, float, Vertex)

Interpolates between three vertices using barycentric weights, writing into `result` a vertex at an arbitrary point inside (or outside) the triangle they form.

```csharp
public static void BarycentricInterpolate(in Vertex a, in Vertex b, in Vertex c, float u, float v, float w, out Vertex result)
```

### Parameters

**** (\[Vertex]\(/engine/6000.6/script-reference/unityengine/uielements/vertex)): The first triangle vertex, weighted by `u`.**** (\[Vertex]\(/engine/6000.6/script-reference/unityengine/uielements/vertex)): The second triangle vertex, weighted by `v`.**** (\[Vertex]\(/engine/6000.6/script-reference/unityengine/uielements/vertex)): The third triangle vertex, weighted by `w`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The barycentric weight of `a`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The barycentric weight of `b`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The barycentric weight of `c`.**** (\[Vertex]\(/engine/6000.6/script-reference/unityengine/uielements/vertex)): Receives the interpolated vertex.

### Remarks

Use this to place a vertex anywhere within a triangle — for example when re-meshing or clipping a fill. As with [Vertex.Lerp](/engine/6000.6/script-reference/unityengine/uielements/vertex/lerp.md), the continuous vertex data is blended and the discrete identifying data is taken from `a`, so the three vertices must belong to the same fill. The weights are expected to sum to 1 for a point inside the triangle, but are not validated.

## BarycentricInterpolate(Vertex, Vertex, Vertex, float, float, float)

Interpolates between three vertices using barycentric weights, returning the vertex at that point. Convenience overload that returns the result instead of writing to an out parameter.

```csharp
public static Vertex BarycentricInterpolate(in Vertex a, in Vertex b, in Vertex c, float u, float v, float w)
```

### Parameters

**** (\[Vertex]\(/engine/6000.6/script-reference/unityengine/uielements/vertex)): The first triangle vertex, weighted by `u`.**** (\[Vertex]\(/engine/6000.6/script-reference/unityengine/uielements/vertex)): The second triangle vertex, weighted by `v`.**** (\[Vertex]\(/engine/6000.6/script-reference/unityengine/uielements/vertex)): The third triangle vertex, weighted by `w`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The barycentric weight of `a`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The barycentric weight of `b`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The barycentric weight of `c`.

### Returns

| Type                                                                       | Description              |
| -------------------------------------------------------------------------- | ------------------------ |
| [Vertex](/engine/6000.6/script-reference/unityengine/uielements/vertex.md) | The interpolated vertex. |
