curvePoint()
Shape / CurvesDescription
Evaluates the Catmull-Rom curve at parameter t.
Syntax
float curvePoint(float a, float b, float c, float d, float t)
Parameters
| Name | Type | Description |
|---|---|---|
| a | float | coordinate of first control point |
| b | float | coordinate of first point |
| c | float | coordinate of second point |
| d | float | coordinate of second control point |
| t | float | value between 0 and 1 |
Returns
floatRelated
Under the Hood
From Processing.h:
float curvePoint(float a, float b, float c, float d, float t);
Under the Hood
From Processing.cpp:
float PApplet::curvePoint(float a,float b,float c,float d,float t){float t2=t*t,t3=t2*t,s=curveTightnessVal;return 0.5f*((-s*t3+2*s*t2-s*t)*a+((2-s)*t3+(s-3)*t2+1)*b+((s-2)*t3+(3-2*s)*t2+s*t)*c+(s*t3-s*t2)*d);}