Returns the linear interpolation between the supplied double-precision vectors.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 4.0+
- Xcode 11.0+
Single-precision and double-precision
linear functions return a vector that's the elementwise linear interpolation between the two supplied vectors.
For example, the following code creates two arrays, vectorA and vectorB, that contain sine waves:
linear with an interpolation constant of 0.5 to generate a new vector that's the average of the two sine waves:
The following figure visualizes the two source vectors: the blue lines at the top and bottom, and the interpolation result: the red line in the center: