How to get control points of a cubic b-spline from interpolation data points?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • othmandroid
    New Member
    • Feb 2011
    • 2

    How to get control points of a cubic b-spline from interpolation data points?

    Hi everybody,
    i wish i will get an answer here i was looking for so long to find a solution to my problem this is it :
    i have a grid of interpolation data points (x, y, z) and i want to know how to find control points for a cubic b-spline that passes exactly on all my interpolation points.
    please help me
    if you can also give me an algorithm in c++ for doing this
    with best regards

    @attmandroid
  • emaghero
    New Member
    • Oct 2006
    • 85

    #2
    Get a good numerical analysis text from a library, "Numerical Analysis" by Burden and Faires gives an explanation of how to fit a curve to a data set using cubic splines. If you just want the code then you can probably find it in "Numerical Recipes in C" by Press et al.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      Can you describe the mathematical relationship of the control points to the interpolation points? That is, are trying to figure out how to write a program or are you trying to find out how cubic splines work?

      Comment

      • othmandroid
        New Member
        • Feb 2011
        • 2

        #4
        Thank you for your reply
        yes I know the mathematical relationship of the control points to the interpolation points, but to resolve the system i need more equations to find control points, for example if i have 3 interpolation points i need more equation sto be able to find controle points, please if you can give me a quick description of the solution then i can implement it my self or giving me a peace of code will also help me :)
        Best Regards

        Comment

        • donbock
          Recognized Expert Top Contributor
          • Mar 2008
          • 2427

          #5
          We're programming gurus, not math gurus. I suggest you google "relaxed cubic spline" for the necessary formulas and algorithms; that should get you started. We can help if you have trouble expressing the algorithms in C/C++.

          Note that a cubic spline goes through all of the interpolation points -- it does not take noise or error bars into account. This might not be the best curve-fitting choice for experimental data.

          Comment

          Working...