Name

curveTangent()

Examples
noFill()
curve(5, 26, 73, 24, 73, 61, 15, 65)
steps = 6
for i in range(steps): 
    t = i / float(steps)
    x = curvePoint(5, 73, 73, 15, t)
    y = curvePoint(26, 24, 61, 65, t)
    #ellipse(x, y, 5, 5)
    tx = curveTangent(5, 73, 73, 15, t)
    ty = curveTangent(26, 24, 61, 65, t)
    a = atan2(ty, tx)
    a -= PI/2.0
    line(x, y, cos(a)*8 + x, sin(a)*8 + y)
Description Calculates the tangent of a point on a curve. There's a good definition of tangent on Wikipedia.
Syntax
curveTangent(a, b, c, d, t)
Parameters
afloat: coordinate of first point on the curve
bfloat: coordinate of first control point
cfloat: coordinate of second control point
dfloat: coordinate of second point on the curve
tfloat: value between 0 and 1
Related curve()
curveVertex()
curvePoint()
bezierTangent()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.