Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Why are quadratic Bezier curves described so obtusely?
6 points by xeonmc on Sept 22, 2022 | hide | past | favorite | 5 comments
A (non-rational) quadratic Bezier curve is a section of a parabola, which is the trajectory of an initial velocity under constant acceleration, which at most spans a plane as only two vectors are involved.

Basic vector addition lets us visualize that a parallelgram grid is formed from the displacement contributed by initial velocity and displacement contributed by acceleration. So it's pretty easy to see that the middle control point forms the direction of acceleration with the midpoint between start and end[1].

Why then are all the sources describing quadratic Bezier curves make absolutely no reference to any meaningful physical quantities of any sort, instead just treating them like some sort of magical incantation about "interpolations of interpolation"? And similarly cubic Bezier curve can easily be described by the parallelpipid grid spanned by the velocity, acceleration, and jerk vectors, so there's no sense in saying that this strange way of describing them is necessary for generalization. The only likely explanation I can think of is laziness, as it doesn't really make much sense to be motivated by some sort of elitism on something so exceedingly simple.

[1] https://i.imgur.com/vP9fLYh.png




Laziness? really?

I think a lot of important and frequently applied elements of math are, like Bezier splines, something that can be understood in different ways, in different contexts. e.g. what is a matrix? You can tell a story about systems of equations, or about tensors or maybe bilinear forms, or about coordinate system transforms, etc. All of these are valid, and good understanding comes from being able to hold multiple views of the same underlying thing simultaneously.

You have embraced one way of interpreting a quadratic Bezier curve, as a curve characterized by some constant second derivative (2 degrees of freedom or DOF), an initial velocity (2 DOF), and an initial position (2 DOF). Someone from computer-aided design (CAD) might specify the curve in terms of the start point (2 DOF), end point (2 DOF), and control point (2 DOF). Someone implementing all this in code might evaluate the basis functions, or might use Casteljau's method to do the lerp of the lerps, as you noted. All of these end up being different views of the same math object, and all of them are sensible.

In particular, what is most "physical" may be subjective. An important use of splines was CAD, where a human is saying: I need something to go from here, to here, in a smooth way that I can nudge with this control point. That is how we interact with cubic Bezier splines in drawing programs, and those control points for specifying the spline are nice and tangible, if not physical. A curve of constant jerk is physical too, I guess, but doesn't align as well with how the expressivity of cubic splines frequently gets invoked.

There is definitely elitism in how some people describe their use of math (behold my sophistication); it's a bummer. More charitably, you could understand it as the author respecting the time of the reader assumed to already understand something about the topic. But don't let that discourage you.


At the very least people could have the decency to draw it as a scissoring X to show that the control point actually represents something tangible, and that the inscribing parallelogram describes the boundaries that the mixture fractions interpolate between.

https://www.desmos.com/calculator/jwg0zxdzjz

(also, nitpicking on your comment, each vectors have DoF of their embedding dimension, it is only 2 in the special case of being laid flat on a plane. In other words cubic Bezier curves are generally 3D, whereas quadratic can only ever be 2D)


It is not the case that cubic Beziers are 3D. There’s a good chance that the font you’re using to read this (especially if you print it out) defines the outline of (2D) letters with a sequence of cubic Beziers. Lots of 2D computer graphics uses cubic Beziers because they ~balance the needs of having lots of DOF for expressivity, while not being so complicated that they’re a pain to evaluate.

And the control points that define a quadratic Bezier could be in any dimension, including 3, or even 1, which is good for plotting the basis functions.

Where you are shapes how you make sense of things. As you learn to see Bézier curves from different viewpoints, the particular physical viewpoint you have now will coexist with others. It’s always that way learning math. That feeling of being disoriented is something to treasure, btw; you won’t always have it.

My hunch is that this video https://youtu.be/aVwxzDHniEw comes from someone who’s path through learning Bézier curves was non-traditional, but they do a beautiful job of explaining and illustrating things. It showed me that I have more to learn too.


That's not quite what I meant when I said cubic are generally 3D. I'm saying that flat-span cubic Beziers are a tiny subset of possible general-span cubic Beziers. The degrees of freedom pertain to the _embedding dimensions_ (could be ten dimensions for instance, which gives each of the control points 10 DoF), but the _span_ of them can be no more than two (for quadratic) or three (for cubic), because there are only ever that many vectors involved respectively.

The linked video is in fact one of the sources I had in mind when referring to "lerps of lerps" style of description, just stretched to half an hour with some auxiliary elaboration on what lerps-of-lerps means. Of course they are all still useful tidbits, but it is still fundamentally the same approach of defining an elephant as the sum of its legs and trunks, albeit with more details about said body parts, but still not saying what the thing _is_ from a more cohesive standpoint. By no means am I asserting "my way is the only way", rather the intent is to point out that the candidate explanations should offer something more than just disembodied _description_ of parts


You're not a graphics programmer, are you?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: