B-Spline how to create control points for a curve to pass through knot values












0












$begingroup$


I want to create a b-spline curve that will pass through all the (knot) points I give it. How do I construct it? Do I need to find the control points for that curve? And if so - how?










share|cite|improve this question









$endgroup$












  • $begingroup$
    Is the knot vector fixed in advance, and if yes what knots are used? Also please add an example of 'knot' points
    $endgroup$
    – Oppenede
    Dec 29 '18 at 21:02
















0












$begingroup$


I want to create a b-spline curve that will pass through all the (knot) points I give it. How do I construct it? Do I need to find the control points for that curve? And if so - how?










share|cite|improve this question









$endgroup$












  • $begingroup$
    Is the knot vector fixed in advance, and if yes what knots are used? Also please add an example of 'knot' points
    $endgroup$
    – Oppenede
    Dec 29 '18 at 21:02














0












0








0





$begingroup$


I want to create a b-spline curve that will pass through all the (knot) points I give it. How do I construct it? Do I need to find the control points for that curve? And if so - how?










share|cite|improve this question









$endgroup$




I want to create a b-spline curve that will pass through all the (knot) points I give it. How do I construct it? Do I need to find the control points for that curve? And if so - how?







spline






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 29 '18 at 9:18









David RefaeliDavid Refaeli

1216




1216












  • $begingroup$
    Is the knot vector fixed in advance, and if yes what knots are used? Also please add an example of 'knot' points
    $endgroup$
    – Oppenede
    Dec 29 '18 at 21:02


















  • $begingroup$
    Is the knot vector fixed in advance, and if yes what knots are used? Also please add an example of 'knot' points
    $endgroup$
    – Oppenede
    Dec 29 '18 at 21:02
















$begingroup$
Is the knot vector fixed in advance, and if yes what knots are used? Also please add an example of 'knot' points
$endgroup$
– Oppenede
Dec 29 '18 at 21:02




$begingroup$
Is the knot vector fixed in advance, and if yes what knots are used? Also please add an example of 'knot' points
$endgroup$
– Oppenede
Dec 29 '18 at 21:02










2 Answers
2






active

oldest

votes


















0












$begingroup$

Suppose that your knot points (not to be confused with the B-spline knots!) are ordered in a sequence $(x_1, dots, x_m)$. Then you can compute a B-spline of order $n$ between each ordered pair $(x_i, x_{i+1})$. You can adjust $n$ in order to set the B-spline regularity.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    can you maybe show an example? say I have (x1,y1) (x2,y2) and (x3,y3). How do I construct a B-spline that passes through all these points ?
    $endgroup$
    – David Refaeli
    Dec 29 '18 at 14:50



















0












$begingroup$

Follows a MATHEMATICA script showing how to construct a special spline type. (Bézier curves) In the script $BL, BQ,BC$ are Bézier curves of first, (linear), second (quadratic) and third (cubic) order and also how them are recursively built. The points $p_1,p_2,p_2,p_4$ can be considered as control points. By properly positioning these control points, we can cause the curve to pass through determined points



$$
begin{array}{l}
{text{BL}[text{p0$_$},text{p1$_$},text{t$_$}]text{:=}(1-t)text{p0}+t text{p1}}\
{text{BQ}[text{p0$_$},text{p1$_$},text{p2$_$},text{t$_$}]text{:=}(1-t)text{BL}[text{p0},text{p1},t]+t text{BL}[text{p1},text{p2},t]}\{text{BC}[text{p0$_$},text{p1$_$},text{p2$_$},text{p3$_$},text{t$_$}]text{:=}(1-t)text{BQ}[text{p0},text{p1},text{p2},t]+t text{BQ}[text{p1},text{p2},text{p3},t]}
end{array}
$$



$$
begin{array}{l}
{p_1={0,0};}\
{p_2={1,1};}\
{p_3={-1,2};}\
{p_4={-2,0};}\
{text{gr1}=text{ParametricPlot}left[text{BC}left[p_1,p_2,p_3,p_4,tright],{t,0,1},text{PlotStyle}to {text{Blue},text{Thick}}right];}\
{text{grp}=text{Table}left[text{Graphics}left[left{text{Red},text{Disk}left[p_k,0.05right]right}right],{k,1,4}right];}\
{text{grl}=text{ListLinePlot}left[left{p_1,p_2,p_3,p_4right},text{PlotStyle}to {text{Dashed}, text{Red}}right];}\
{text{Show}[text{gr1},text{grp},text{grl},text{PlotRange}to text{All}]}
end{array}
$$



Attached a plot for this setup



enter image description here






share|cite|improve this answer









$endgroup$














    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3055677%2fb-spline-how-to-create-control-points-for-a-curve-to-pass-through-knot-values%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    Suppose that your knot points (not to be confused with the B-spline knots!) are ordered in a sequence $(x_1, dots, x_m)$. Then you can compute a B-spline of order $n$ between each ordered pair $(x_i, x_{i+1})$. You can adjust $n$ in order to set the B-spline regularity.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      can you maybe show an example? say I have (x1,y1) (x2,y2) and (x3,y3). How do I construct a B-spline that passes through all these points ?
      $endgroup$
      – David Refaeli
      Dec 29 '18 at 14:50
















    0












    $begingroup$

    Suppose that your knot points (not to be confused with the B-spline knots!) are ordered in a sequence $(x_1, dots, x_m)$. Then you can compute a B-spline of order $n$ between each ordered pair $(x_i, x_{i+1})$. You can adjust $n$ in order to set the B-spline regularity.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      can you maybe show an example? say I have (x1,y1) (x2,y2) and (x3,y3). How do I construct a B-spline that passes through all these points ?
      $endgroup$
      – David Refaeli
      Dec 29 '18 at 14:50














    0












    0








    0





    $begingroup$

    Suppose that your knot points (not to be confused with the B-spline knots!) are ordered in a sequence $(x_1, dots, x_m)$. Then you can compute a B-spline of order $n$ between each ordered pair $(x_i, x_{i+1})$. You can adjust $n$ in order to set the B-spline regularity.






    share|cite|improve this answer









    $endgroup$



    Suppose that your knot points (not to be confused with the B-spline knots!) are ordered in a sequence $(x_1, dots, x_m)$. Then you can compute a B-spline of order $n$ between each ordered pair $(x_i, x_{i+1})$. You can adjust $n$ in order to set the B-spline regularity.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Dec 29 '18 at 10:42









    mathcounterexamples.netmathcounterexamples.net

    26.9k22158




    26.9k22158












    • $begingroup$
      can you maybe show an example? say I have (x1,y1) (x2,y2) and (x3,y3). How do I construct a B-spline that passes through all these points ?
      $endgroup$
      – David Refaeli
      Dec 29 '18 at 14:50


















    • $begingroup$
      can you maybe show an example? say I have (x1,y1) (x2,y2) and (x3,y3). How do I construct a B-spline that passes through all these points ?
      $endgroup$
      – David Refaeli
      Dec 29 '18 at 14:50
















    $begingroup$
    can you maybe show an example? say I have (x1,y1) (x2,y2) and (x3,y3). How do I construct a B-spline that passes through all these points ?
    $endgroup$
    – David Refaeli
    Dec 29 '18 at 14:50




    $begingroup$
    can you maybe show an example? say I have (x1,y1) (x2,y2) and (x3,y3). How do I construct a B-spline that passes through all these points ?
    $endgroup$
    – David Refaeli
    Dec 29 '18 at 14:50











    0












    $begingroup$

    Follows a MATHEMATICA script showing how to construct a special spline type. (Bézier curves) In the script $BL, BQ,BC$ are Bézier curves of first, (linear), second (quadratic) and third (cubic) order and also how them are recursively built. The points $p_1,p_2,p_2,p_4$ can be considered as control points. By properly positioning these control points, we can cause the curve to pass through determined points



    $$
    begin{array}{l}
    {text{BL}[text{p0$_$},text{p1$_$},text{t$_$}]text{:=}(1-t)text{p0}+t text{p1}}\
    {text{BQ}[text{p0$_$},text{p1$_$},text{p2$_$},text{t$_$}]text{:=}(1-t)text{BL}[text{p0},text{p1},t]+t text{BL}[text{p1},text{p2},t]}\{text{BC}[text{p0$_$},text{p1$_$},text{p2$_$},text{p3$_$},text{t$_$}]text{:=}(1-t)text{BQ}[text{p0},text{p1},text{p2},t]+t text{BQ}[text{p1},text{p2},text{p3},t]}
    end{array}
    $$



    $$
    begin{array}{l}
    {p_1={0,0};}\
    {p_2={1,1};}\
    {p_3={-1,2};}\
    {p_4={-2,0};}\
    {text{gr1}=text{ParametricPlot}left[text{BC}left[p_1,p_2,p_3,p_4,tright],{t,0,1},text{PlotStyle}to {text{Blue},text{Thick}}right];}\
    {text{grp}=text{Table}left[text{Graphics}left[left{text{Red},text{Disk}left[p_k,0.05right]right}right],{k,1,4}right];}\
    {text{grl}=text{ListLinePlot}left[left{p_1,p_2,p_3,p_4right},text{PlotStyle}to {text{Dashed}, text{Red}}right];}\
    {text{Show}[text{gr1},text{grp},text{grl},text{PlotRange}to text{All}]}
    end{array}
    $$



    Attached a plot for this setup



    enter image description here






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      Follows a MATHEMATICA script showing how to construct a special spline type. (Bézier curves) In the script $BL, BQ,BC$ are Bézier curves of first, (linear), second (quadratic) and third (cubic) order and also how them are recursively built. The points $p_1,p_2,p_2,p_4$ can be considered as control points. By properly positioning these control points, we can cause the curve to pass through determined points



      $$
      begin{array}{l}
      {text{BL}[text{p0$_$},text{p1$_$},text{t$_$}]text{:=}(1-t)text{p0}+t text{p1}}\
      {text{BQ}[text{p0$_$},text{p1$_$},text{p2$_$},text{t$_$}]text{:=}(1-t)text{BL}[text{p0},text{p1},t]+t text{BL}[text{p1},text{p2},t]}\{text{BC}[text{p0$_$},text{p1$_$},text{p2$_$},text{p3$_$},text{t$_$}]text{:=}(1-t)text{BQ}[text{p0},text{p1},text{p2},t]+t text{BQ}[text{p1},text{p2},text{p3},t]}
      end{array}
      $$



      $$
      begin{array}{l}
      {p_1={0,0};}\
      {p_2={1,1};}\
      {p_3={-1,2};}\
      {p_4={-2,0};}\
      {text{gr1}=text{ParametricPlot}left[text{BC}left[p_1,p_2,p_3,p_4,tright],{t,0,1},text{PlotStyle}to {text{Blue},text{Thick}}right];}\
      {text{grp}=text{Table}left[text{Graphics}left[left{text{Red},text{Disk}left[p_k,0.05right]right}right],{k,1,4}right];}\
      {text{grl}=text{ListLinePlot}left[left{p_1,p_2,p_3,p_4right},text{PlotStyle}to {text{Dashed}, text{Red}}right];}\
      {text{Show}[text{gr1},text{grp},text{grl},text{PlotRange}to text{All}]}
      end{array}
      $$



      Attached a plot for this setup



      enter image description here






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        Follows a MATHEMATICA script showing how to construct a special spline type. (Bézier curves) In the script $BL, BQ,BC$ are Bézier curves of first, (linear), second (quadratic) and third (cubic) order and also how them are recursively built. The points $p_1,p_2,p_2,p_4$ can be considered as control points. By properly positioning these control points, we can cause the curve to pass through determined points



        $$
        begin{array}{l}
        {text{BL}[text{p0$_$},text{p1$_$},text{t$_$}]text{:=}(1-t)text{p0}+t text{p1}}\
        {text{BQ}[text{p0$_$},text{p1$_$},text{p2$_$},text{t$_$}]text{:=}(1-t)text{BL}[text{p0},text{p1},t]+t text{BL}[text{p1},text{p2},t]}\{text{BC}[text{p0$_$},text{p1$_$},text{p2$_$},text{p3$_$},text{t$_$}]text{:=}(1-t)text{BQ}[text{p0},text{p1},text{p2},t]+t text{BQ}[text{p1},text{p2},text{p3},t]}
        end{array}
        $$



        $$
        begin{array}{l}
        {p_1={0,0};}\
        {p_2={1,1};}\
        {p_3={-1,2};}\
        {p_4={-2,0};}\
        {text{gr1}=text{ParametricPlot}left[text{BC}left[p_1,p_2,p_3,p_4,tright],{t,0,1},text{PlotStyle}to {text{Blue},text{Thick}}right];}\
        {text{grp}=text{Table}left[text{Graphics}left[left{text{Red},text{Disk}left[p_k,0.05right]right}right],{k,1,4}right];}\
        {text{grl}=text{ListLinePlot}left[left{p_1,p_2,p_3,p_4right},text{PlotStyle}to {text{Dashed}, text{Red}}right];}\
        {text{Show}[text{gr1},text{grp},text{grl},text{PlotRange}to text{All}]}
        end{array}
        $$



        Attached a plot for this setup



        enter image description here






        share|cite|improve this answer









        $endgroup$



        Follows a MATHEMATICA script showing how to construct a special spline type. (Bézier curves) In the script $BL, BQ,BC$ are Bézier curves of first, (linear), second (quadratic) and third (cubic) order and also how them are recursively built. The points $p_1,p_2,p_2,p_4$ can be considered as control points. By properly positioning these control points, we can cause the curve to pass through determined points



        $$
        begin{array}{l}
        {text{BL}[text{p0$_$},text{p1$_$},text{t$_$}]text{:=}(1-t)text{p0}+t text{p1}}\
        {text{BQ}[text{p0$_$},text{p1$_$},text{p2$_$},text{t$_$}]text{:=}(1-t)text{BL}[text{p0},text{p1},t]+t text{BL}[text{p1},text{p2},t]}\{text{BC}[text{p0$_$},text{p1$_$},text{p2$_$},text{p3$_$},text{t$_$}]text{:=}(1-t)text{BQ}[text{p0},text{p1},text{p2},t]+t text{BQ}[text{p1},text{p2},text{p3},t]}
        end{array}
        $$



        $$
        begin{array}{l}
        {p_1={0,0};}\
        {p_2={1,1};}\
        {p_3={-1,2};}\
        {p_4={-2,0};}\
        {text{gr1}=text{ParametricPlot}left[text{BC}left[p_1,p_2,p_3,p_4,tright],{t,0,1},text{PlotStyle}to {text{Blue},text{Thick}}right];}\
        {text{grp}=text{Table}left[text{Graphics}left[left{text{Red},text{Disk}left[p_k,0.05right]right}right],{k,1,4}right];}\
        {text{grl}=text{ListLinePlot}left[left{p_1,p_2,p_3,p_4right},text{PlotStyle}to {text{Dashed}, text{Red}}right];}\
        {text{Show}[text{gr1},text{grp},text{grl},text{PlotRange}to text{All}]}
        end{array}
        $$



        Attached a plot for this setup



        enter image description here







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Dec 29 '18 at 12:15









        CesareoCesareo

        10k3518




        10k3518






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3055677%2fb-spline-how-to-create-control-points-for-a-curve-to-pass-through-knot-values%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Le Mesnil-Réaume

            Ida-Boy-Ed-Garten

            web3.py web3.isConnected() returns false always