Back to Adaptive Vision Library Lite websiteYou are here:
Start »
Geometry 2D Interpolations »
LerpPoints
Header: | AVL.h |
Namespace: | avl |
Linearly interpolates between two points.
Syntax
void avl::LerpPoints
(
const avl::Point2D& inPoint0,
const avl::Point2D& inPoint1,
const float inLambda,
avl::Point2D& outPoint
)
Parameters
|
Name |
Type |
Range |
Default |
Description |
![](../../img/in.png) |
inPoint0 |
const Point2D& |
|
|
|
![](../../img/in.png) |
inPoint1 |
const Point2D& |
|
|
|
![](../../img/in.png) |
inLambda |
const float |
- - ![](../../img/infinity.png) |
0.5f |
Interpolation between the input points where 0.0 value is equal to inPoint0 and 1.0 to inPoint1 |
![](../../img/out.png) |
outPoint |
Point2D& |
|
|
|
Examples
LerpPoints performed on red inPoint0 and blue inPoint1 with inLambda = 0,25. Green is the resulting outPoint.
LerpPoints performed on red inPoint0 and blue inPoint1 with inLambda = -1,0. Green is the resulting outPoint.
Remarks
Please note that:
- interpolation begins at inPoint0,
- for positive inLambda values interpolation is performed in the direction of inPoint1 while for negative - in the direction of a point which is the result of the following operation: (inPoint0 - inPoint1), in example a point acquired by mirroring inPoint1 by inPoint0.
Hence when
inLambda = 0,0,
outPoint is equal to
inPoint0, while for
inLambda = 1,0 it's the same as
inPoint1 and for
inLambda = -1,0 - as (
inPoint0 -
inPoint1). Other
inLambda values interpolate between the input points and beyond.