[HN Gopher] Cubic Bezier: From Math to Motion
       ___________________________________________________________________
        
       Cubic Bezier: From Math to Motion
        
       Author : extesy
       Score  : 35 points
       Date   : 2021-12-10 18:42 UTC (2 days ago)
        
 (HTM) web link (blog.maximeheckel.com)
 (TXT) w3m dump (blog.maximeheckel.com)
        
       | ogogmad wrote:
       | You can derive the formula for this using the Chinese Remainder
       | Theorem.
       | 
       | Consider the problem of finding a polynomial p(x) such that
       | p(x_i) = y_i for some finite set of (x_i) and (y_i). The classic
       | approach to this is _Lagrange interpolation_ , which can be seen
       | as a special case of the Chinese Remainder Theorem. Essentially,
       | you are trying to find a p which satisfies the following modular
       | congruences:                 p(x) == y_i (mod (x - x_i))
       | 
       | The constructive proof of CRT, specialised to this problem,
       | yields an algorithm equivalent to Lagrange interpolation. To
       | extend Lagrange interpolation so as to include derivative
       | information y'_i at each x_i, change that congruence to:
       | p(x) == y_i + y'_i (x - x_i) (mod (x - x_i)^2)
       | 
       | And to give second derivative information, change the modular
       | congruence to:                 p(x) == y_i + y'_i (x - x_i) +
       | y''_i (x - x_i)^2 / 2! (mod (x - x_i)^3)
       | 
       | And so on...
        
         | [deleted]
        
       | tsumnia wrote:
       | Bezier curves are actually my favorite way to teach recursion.
       | They give a nice visual representation of what's happening, the
       | base case is pretty straight forward, and so is the math. The
       | time-step element adds just enough extra complexity to take it
       | beyond "let's sum a list" or "check if a string is a palindrome".
        
       | tobmlt wrote:
       | If you happen to desire to implement your own NURBS library,
       | (and/or the bspline and bezier simplifications) take the nurbs
       | book c reference implementation, and modernize, convert to you
       | language of choice.
       | 
       | https://link.springer.com/book/10.1007/978-3-642-97385-7
        
       | cobbal wrote:
       | For a really in-depth, online resource on Bezier curves, I
       | constantly consult https://pomax.github.io/bezierinfo/
        
       ___________________________________________________________________
       (page generated 2021-12-12 23:02 UTC)