Skip to content

Commit 01bb810

Browse files
committed
Add principle of checking the spline to comment
The way of checking the spline is flat or not is to calculate the distance from a control point to the line connected by the point A and point D, which is based on the Convex Hull Property of Bézier Curves that Bézier Curve lies within the convex hull of its control points.
1 parent d8aecb9 commit 01bb810

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/spline.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ static void _de_casteljau(twin_spline_t *spline,
5757

5858
/*
5959
* Return an upper bound on the distance (squared) that could result from
60-
* approximating a spline with a line segment connecting the two endpoints.
60+
* approximating a spline with a line segment connecting the two endpoints,
61+
* which is based on the Convex Hull Property of Bézier Curves: The Bézier Curve
62+
* lies completely in the convex hull of the given control points. Therefore, we
63+
* can use control points B and C to approximate the actual spline.
6164
*/
6265
static twin_dfixed_t _twin_spline_distance_squared(twin_spline_t *spline)
6366
{

0 commit comments

Comments
 (0)