Difference between revisions of "Interpolation/Cubic/Float"
< Interpolation | Cubic
Jump to navigation
Jump to search
(Created page with "{{LSL_Function |mode=user |func=fCub |p1_type=float|p1_name=a |p2_type=float|p2_name=b |p3_type=float|p3_name=c |p4_type=float|p4_name=d |p5_type=float|p5_name=t |return_type=flo…") |
m (<lsl> tag to <source>) |
||
Line 11: | Line 11: | ||
|func_desc=[[Image:Interp_Chart3.png|frame|right]] | |func_desc=[[Image:Interp_Chart3.png|frame|right]] | ||
Cubic interpolation between four floating point values. | Cubic interpolation between four floating point values. | ||
|spec=< | |spec=<source lang="lsl2">float fCub(float a, float b, float c, float d,float t) { | ||
float P = (d-c)-(a-b); | float P = (d-c)-(a-b); | ||
return P*llPow(t,3) + ((a-b)-P)*llPow(t,2) + (c-a)*t + b; | return P*llPow(t,3) + ((a-b)-P)*llPow(t,2) + (c-a)*t + b; | ||
} | } | ||
// 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:02, 24 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Specification
float fCub(float a, float b, float c, float d,float t) {
float P = (d-c)-(a-b);
return P*llPow(t,3) + ((a-b)-P)*llPow(t,2) + (c-a)*t + b;
}
// Released into public domain. By Nexii Malthus.
Examples