Difference between revisions of "Interpolation/Linear/Float"
< Interpolation | Linear
Jump to navigation
Jump to search
m |
m (<lsl> tag to <source>) |
||
Line 9: | Line 9: | ||
|func_desc=[[Image:Interp_Chart1.png|frame|right]] | |func_desc=[[Image:Interp_Chart1.png|frame|right]] | ||
Interpolates between two floating point values in a linear fashion. | Interpolates between two floating point values in a linear fashion. | ||
|spec=< | |spec=<source lang="lsl2">float fLin(float x, float y, float t) { | ||
return x*(1-t) + y*t; | return x*(1-t) + y*t; | ||
} | } | ||
// Released into public domain. By Nexii Malthus.</ | // Released into public domain. By Nexii Malthus.</source> | ||
|examples=< | |examples=<source lang="lsl2">float value = fLin(-5, 15, 0.6); // value == 7</source> | ||
|cat1=Examples | |cat1=Examples | ||
}} | }} |
Latest revision as of 16:04, 24 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Specification
float fLin(float x, float y, float t) {
return x*(1-t) + y*t;
}
// Released into public domain. By Nexii Malthus.
Examples
float value = fLin(-5, 15, 0.6); // value == 7