Skip to content

Commit

Permalink
bezierQuadratic
Browse files Browse the repository at this point in the history
  • Loading branch information
gecko0307 committed Nov 16, 2023
1 parent b07a190 commit 7cf26ac
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dlib/math/interpolation/bezier.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ module dlib.math.interpolation.bezier;
import dlib.math.vector;

/**
* Computes cubic Bézier curve
* Computes quadratic Bézier curve
*/
T bezierQuadratic(T)(T A, T B, T C, T t)
{
T s = cast(T)1.0 - t;
return s * s * A + 2.0 * s * B + t * t * C;
}

/**
* Computes cubic Bézier curve
*/
T bezierCubic(T) (T A, T B, T C, T D, T t)
{
Expand Down

0 comments on commit 7cf26ac

Please sign in to comment.