Back to FabImage Library websiteYou are here:
Start »
Function Reference »
Geometry 2D »
Geometry 2D Interpolations »
LerpPaths
Header: |
FIL.h
|
Namespace: |
fil |
Module: |
FoundationLite |
Linearly interpolates between two paths.
Syntax
C++
C#
void fil::LerpPaths
(
const fil::Path& inPath0,
const fil::Path& inPath1,
const float inLambda,
fil::Path& outPath
)
Parameters
|
Name |
Type |
Range |
Default |
Description |
 |
inPath0 |
const Path& |
|
|
|
 |
inPath1 |
const Path& |
|
|
First input path |
 |
inLambda |
const float |
- -  |
0.5f |
Interpolation between the input paths where 0.0 value is equal to inPath0 and 1.0 to inPath1 |
 |
outPath |
Path& |
|
|
Output path |
Examples
LerpPaths performed on red inPath0 and blue inPath1 with inLambda = 0,25. Green is the resulting outPath.
LerpPaths performed on red inPath0 and blue inPath1 with inLambda = -1,0. Green is the resulting outPath.
Remarks
Please note that:
- interpolation begins at inPath0,
- for positive inLambda values interpolation is performed in the direction of inPath1 while for negative - in the direction of a path which is the result of the following operation: (inPath0 - inPath1), in example a path consisting of inPath1 points mirrored by the corresponding inPath0 points.
Hence when
inLambda = 0,0,
outPath is equal to
inPath0, while for
inLambda = 1,0 it's the same as
inPath1 and for
inLambda = -1,0 - as (
inPath0 -
inPath1). Other
inLambda values interpolate between the input paths and beyond.
Errors
List of possible exceptions:
Error type |
Description |
DomainError |
Numbers of points in paths are not the same in LerpPaths. |
DomainError |
Open and closed paths on input in LerpPaths. |