
Mathematical Intuition Behind Bezier Curves - farashh
https://buildingvts.com/mathematical-intuition-behind-bezier-curves-2ea4e9645681
======
dietrichepp
The geometric intuition is important but missing. Calculus and algebra is not
everything.

Short version:

Imagine a line connecting A to B. Now imagine a point sliding across that
line, starting at A and going to B.

Now consider a line A to B and a second line B to C. A point slides across
each line: one from A to B, another from B to C. Now draw a line connecting
these two points, and imagine a point sliding across that line.

This moving line starts as A to B, ends as B to C, so the point sliding along
it goes from A to C along a curved path. This is a quadratic Bézier curve.

Add another layer and you get cubic.

~~~
blahedo
The crucial insight I drew from the OP was that Bézier curves are essentially
a _weighted average_ of the endpoints and control points, with the weights
shifting an a parametric way. Somehow that had never clicked before. Your
comment gives a nice way to elabourate on how the parameterisation works.

------
jacobolus
For anyone with enough formal mathematics background to follow the argument,
Lyle Ramshaw’s monograph, _On multiplying points: the paired algebras of forms
and sites_ , supplies the clearest formalism for understanding and working
with Bézier curves and various CAGD surface primitives.
[http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-
RR-169.html](http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-169.html)
(Note: ~150 page math book, takes some work to follow.)

Also check out the pomax bezier curve primer, which is filled with interactive
diagrams and nice explanations of algorithms for doing anything you might like
with Bézier curves,
[http://pomax.github.io/bezierinfo/](http://pomax.github.io/bezierinfo/)
(previous discussions,
[https://news.ycombinator.com/item?id=11402656](https://news.ycombinator.com/item?id=11402656)
[https://news.ycombinator.com/item?id=8804691](https://news.ycombinator.com/item?id=8804691))

~~~
theoh
Yes, this (Lyle Ramshaw's paper). My impression is that his work succeeds in
finding the simplest human-comprehensible way of defining these objects. It's
very much not the pragmatic "local hacker" approach to graphics, which can be
forbidding.

I also enjoyed this interview with Tony DeRose:
[https://www.youtube.com/watch?v=mX0NB9IyYpU](https://www.youtube.com/watch?v=mX0NB9IyYpU)

It can be so discouraging for people to encounter this stuff (geometric
modelling primitives) as a mysterious incantation, essentially as raw
algebraic code. I think there's probably more scope to humanize it, as Ramshaw
and DeRose's demonstrations suggest.

------
cscheid
Jason Davies has a really great interactive demo of Bezier curves:
[https://www.jasondavies.com/animated-
bezier/](https://www.jasondavies.com/animated-bezier/)

~~~
vinchuco
\+ Bezier surfaces: [http://acko.net/blog/making-
mathbox/](http://acko.net/blog/making-mathbox/)

Talk:
[https://youtu.be/Zkx1aKv2z8o?t=15m54s](https://youtu.be/Zkx1aKv2z8o?t=15m54s)

------
crispyambulance
To complement, here's a particularly lucid explanation of how bezier curves
are constructed that appeals to geometric intuition:
[https://vimeo.com/106757336](https://vimeo.com/106757336)

------
dclowd9901
Bezier curves are really cool and fun to learn. I actually had built an
Impact.js bezier tool plugin for a shmup I was working on a while ago:
[https://github.com/dclowd9901/impactjsBezier](https://github.com/dclowd9901/impactjsBezier)

I did different things like toy with caching movement on the curve, having
constant speed on the path, etc. There's even a bit of calculus in there, in
estimating the length of the curve.

------
CountHackulus
I only really found out how easy and fast Bezier curves are recently when I
was adding some smoothing pathing to a game. They're really impressively
useful.

~~~
boulos
You probably want a Catmull-Rom or similar interpolating (instead of
approximating) spline. It's much easier to control animation or other paths
when you know it'll precisely go through the points you specify.

~~~
blt
You also need to care about velocity when using splines as trajectories. In
general, if you sample a spline at a constant _delta-t_ , your speed through
the world won't be constant.

~~~
CountHackulus
This is especially true if you've got large smooth curves with small "sharp"
curves that you want to keep a constant speed over. You can mostly just ignore
it if all of your curves have a fairly constant curvature, but obviously test
first.

------
boulos
I don't think this does a great job of building up an intuition of how these
curves are derived. Instead, I'd recommend starting with quadratic (and
noticing the constraints on the tangents) and then realize how the cubic is
built up from that. Like all (later discovered) splines it's a really elegant
and simple thing!

------
Pingviini
Fascinating article!

