1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-29 11:10:38 +02:00

Edits to de Casteljau section. (#182)

* Edits to de Casteljau section.

* Update content.en-GB.md
This commit is contained in:
Simon Cozens
2019-06-11 01:05:37 +01:00
committed by Pomax
parent 50d709da18
commit 8989cee2c6

View File

@@ -1,6 +1,6 @@
# 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:
@@ -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.
- Place markers along each of these line at distance `t`.
- Form lines between `those` points. This'll be `n-2` lines.
- 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`.
- 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`.
<div className="howtocode">