interpolation/Linear/Vector
< Interpolation | Linear
Jump to navigation
Jump to search
Revision as of 02:24, 14 September 2011 by Nexii Malthus (talk | contribs) (Created page with "{{LSL_Function |mode=user |func=vLin |p1_type=vector|p1_name=x |p2_type=vector|p2_name=y |p3_type=float|p3_name=t |return_type=vector |return_value=returns the interpolation betw…")
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
<lsl>vector vLin(vector x, vector y, float t){
return x*(1-t) + y*t;
}</lsl>
Examples
<lsl> vector x = <-5, 1, 10>; vector y = <15, 2, 2>;
vector z = vLin(x, y, 0.6); // z == <7, 1.6, 5.2></lsl>