( begin auto-generated from curveTangent.xml ) Calculates the tangent of a point on a curve. There's a good definition of tangent on Wikipedia . ( end auto-generated ) Advanced Code thanks to Dave Bollinger (Bug #715
(float a, float b, float c, float d, float t)
| 3479 | * @see PGraphics#bezierTangent(float, float, float, float, float) |
| 3480 | */ |
| 3481 | public float curveTangent(float a, float b, float c, float d, float t) { |
| 3482 | curveInitCheck(); |
| 3483 | |
| 3484 | float tt3 = t * t * 3; |
| 3485 | float t2 = t * 2; |
| 3486 | PMatrix3D cb = curveBasisMatrix; |
| 3487 | |
| 3488 | // not optimized (and probably need not be) |
| 3489 | return (a * (tt3*cb.m00 + t2*cb.m10 + cb.m20) + |
| 3490 | b * (tt3*cb.m01 + t2*cb.m11 + cb.m21) + |
| 3491 | c * (tt3*cb.m02 + t2*cb.m12 + cb.m22) + |
| 3492 | d * (tt3*cb.m03 + t2*cb.m13 + cb.m23) ); |
| 3493 | } |
| 3494 | |
| 3495 | |
| 3496 | /** |
nothing calls this directly
no test coverage detected