interpolation/Linear/Vector
< Interpolation | Linear
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: vector vLin( vector x, vector y, float t );
Interpolates between two vector values in a linear fashion.
Returns a vector
• vector | x | |||
• vector | y | |||
• float | t |
Specification
vector vLin(vector x, vector y, float t){
return x*(1-t) + y*t;
}
// Released into public domain. By Nexii Malthus.
Examples
vector x = <-5, 1, 10>;
vector y = <15, 2, 2>;
vector z = vLin(x, y, 0.6); // z == <7, 1.6, 5.2>