# `GSGlyph interpolate:masters:error:`

*Instance Method*

A detached layer formed by applying interpolation coefficients to compatible source layers.

## Declaration

```swift
func interpolate(_ interpolation: [AnyHashable : Any], masters: [Any]) throws -> GSLayer
```

```objc
- (GSLayer *) interpolate:(NSDictionary *) interpolation masters:(NSArray *) masters error:(NSError **) error;
```

```python
interpolate_masters_error_(interpolation: dict, masters: list) -> tuple[GSLayer, NSError]
```

## Parameters

- `interpolation` — The interpolation coefficient for each participating layer or font master identifier.
- `masters` — The font masters corresponding to the source layers.
- `error` — On return, an error that prevented complete interpolation.

## Discussion

The coefficients are keyed by layer or font master identifier. A coefficient can be scalar or contain independent horizontal and vertical values. The source layers must have matching structure.

## See Also

### Interpolation

- [`GSGlyph interpolateSmartLayer:instance:scale:targetGlyph:`](/Core/GlyphsCore/GSGlyph/interpolateSmartLayer:instance:scale:targetGlyph:) — Adds the corresponding interpolated Smart Component layers to a target glyph.
- [`GSGlyph replaceLayersWithInterpolation:error:`](/Core/GlyphsCore/GSGlyph/replaceLayersWithInterpolation:error:) — Replaces layer contents with interpolation from the remaining layers in each layer group.
- [`GSGlyph nextLayerId:layerPos:onAxis:direction:`](/Core/GlyphsCore/GSGlyph/nextLayerId:layerPos:onAxis:direction:) — Finds the nearest font master in one direction along an axis while keeping the other axis coordinates fixed.

