Lerp is a simple single command module for Linear Interpolation.
It gives you a point between two other points.
You can install Lerp from the PowerShell gallery
Install-Module Lerp -Scope CurrentUser -ForceOnce installed, you can import the module with:
Import-Module Lerp -PassThruYou can also clone the repo and import the module locally:
git clone https://github.com/PoshWeb/Lerp
cd ./Lerp
Import-Module ./ -PassThruLerp has 2 functions
Lerp performs linear interpolation in one, two, three, or four dimensions.
This calculates the point along a straight line between two points.
| Name | Type | Description |
|---|---|---|
| Start | PSObject | The start point |
| End | PSObject | The end point |
| Amount | Single | The amount of lerp The percentage of change between two points |
Lerp in 1D
lerp 1 2 .5Lerp in 2D
lerp 1,2 3,4 .5Lerp in 3D
lerp 1,2,3 4,5,6 .5Lerp in 4D
lerp 1,2,3,4 5,6,7,8 .5Lerp performs linear interpolation in one, two, three, or four dimensions.
This calculates the point along a straight line between two points.
| Name | Type | Description |
|---|---|---|
| Start | PSObject | The start point |
| End | PSObject | The end point |
| Amount | Single | The amount of lerp The percentage of change between two points |
Lerp in 1D
lerp 1 2 .5Lerp in 2D
lerp 1,2 3,4 .5Lerp in 3D
lerp 1,2,3 4,5,6 .5Lerp in 4D
lerp 1,2,3,4 5,6,7,8 .5