mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-29 19:20:39 +02:00
Edits to de Casteljau section. (#182)
* Edits to de Casteljau section. * Update content.en-GB.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# de Casteljau's algorithm
|
# de Casteljau's algorithm
|
||||||
|
|
||||||
If we want to draw Bézier curves we can run through all values of `t` from 0 to 1 and then compute the weighted basis function, getting the `x/y` values we need to plot, but the more complex the curve gets, the more expensive this becomes. Instead, we can use "de Casteljau's algorithm" to draw curves, which is a geometric approach to drawing curves, and really easy to implement. So easy, in fact, you can do it by hand with a pencil and ruler.
|
If we want to draw Bézier curves, we can run through all values of `t` from 0 to 1 and then compute the weighted basis function at each value, getting the `x/y` values we need to plot. Unfortunately, the more complex the curve gets, the more expensive this computation becomes. Instead, we can use *de Casteljau's algorithm* to draw curves. This is a geometric approach to curve drawing, and it's really easy to implement. So easy, in fact, you can do it by hand with a pencil and ruler.
|
||||||
|
|
||||||
Rather than using our calculus function to find `x/y` values for `t`, let's do this instead:
|
Rather than using our calculus function to find `x/y` values for `t`, let's do this instead:
|
||||||
|
|
||||||
@@ -10,8 +10,8 @@ Rather than using our calculus function to find `x/y` values for `t`, let's do t
|
|||||||
- Now form lines between `those` points. This gives `n-1` lines.
|
- Now form lines between `those` points. This gives `n-1` lines.
|
||||||
- Place markers along each of these line at distance `t`.
|
- Place markers along each of these line at distance `t`.
|
||||||
- Form lines between `those` points. This'll be `n-2` lines.
|
- Form lines between `those` points. This'll be `n-2` lines.
|
||||||
- place markers, form lines, place markers, etc.
|
- Place markers, form lines, place markers, etc.
|
||||||
- repeat this until you have only one line left. The point `t` on that line coincides with the original curve point at `t`.
|
- Repeat this until you have only one line left. The point `t` on that line coincides with the original curve point at `t`.
|
||||||
|
|
||||||
<div className="howtocode">
|
<div className="howtocode">
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user