curveTangent()
Shape / CurvesDescription
Calculates the tangent of a point on a Catmull-Rom curve.
Syntax
float curveTangent(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 curveTangent(float a, float b, float c, float d, float t);
Under the Hood
From Processing.cpp:
float PApplet::curveTangent(float a,float b,float c,float d,float t){float t2=t*t,s=curveTightnessVal;return 0.5f*((-3*s*t2+4*s*t-s)*a+(3*(2-s)*t2+2*(s-3)*t)*b+(3*(s-2)*t2+2*(3-2*s)*t+s)*c+(3*s*t2-2*s*t)*d);}