Difference between revisions of "Interpolation/Cosine/Float"
< Interpolation | Cosine
Jump to navigation
Jump to search
(Created page with "{{LSL_Function |mode=user |func=fCos |p1_type=float|p1_name=x |p2_type=float|p2_name=y |p3_type=float|p3_name=t |return_type=float |return_value=returns the interpolation between…") |
m (<lsl> tag to <source>) |
||
(One intermediate revision by one other user not shown) | |||
Line 7: | Line 7: | ||
|return_type=float | |return_type=float | ||
|return_value=returns the interpolation between x and y | |return_value=returns the interpolation between x and y | ||
|func_desc= | |func_desc=[[Image:Interp_Chart2.png|frame|right]] | ||
Cosine interpolation between two floating point values. | Cosine interpolation between two floating point values. | ||
|spec=< | |spec=<source lang="lsl2">float fCos(float x, float y, float t) { | ||
float F = (1-llCos(t*PI))/2; | float F = (1-llCos(t*PI))/2; | ||
return x*(1-F)+y*F; | return x*(1-F)+y*F; | ||
} | } | ||
// Released into public domain. By Nexii Malthus.</ | // Released into public domain. By Nexii Malthus.</source> | ||
|examples=< | |examples=<source lang="lsl2"></source> | ||
|cat1=Examples | |cat1=Examples | ||
}} | }} |
Latest revision as of 16:00, 24 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Specification
float fCos(float x, float y, float t) {
float F = (1-llCos(t*PI))/2;
return x*(1-F)+y*F;
}
// Released into public domain. By Nexii Malthus.
Examples