how to calculate the value of “t” for the highest point in a quadratic bezier curve?











up vote
0
down vote

favorite












I need to find a the value of t exactly at the point where the curve stops going up an start going down, But I have no idea how to get this value I have the 3 control points values, the blue dot on the left is the control point 1, the big red dot is the control point 2 and the blue dot on the right is the control point 3...



control points view



the black dot is the control point for t = 0.5



and the difference in t for each colored dot is 0.1



is the first image it's possible to notice that the highest point are exactly or very close to the yellow dot or in other words t = 0.4, in the center image the black dot is on the top (t = 0.5) and the last image the top is very close to the cyan dot (t = 0.6)...



to find the position for each of these colored dots I'm using the formula..




curvePoint = A *(1-t)^2 + B * 2t(1-t) + C * t^2




where A = center of the first blue dot, B = center of the big red dot, C = last blue dot and and t goes from 0 to 1 in increments of 0.1...



my question is, how to find out t mathematically? when I drag the big red dot the curve follows the control point but I have no idea what's the t value for the highest point in the given configuration...



Is there any formula to find this value?
I hope I was able to make myself clear



thank you in advance for the answers!










share|cite|improve this question


























    up vote
    0
    down vote

    favorite












    I need to find a the value of t exactly at the point where the curve stops going up an start going down, But I have no idea how to get this value I have the 3 control points values, the blue dot on the left is the control point 1, the big red dot is the control point 2 and the blue dot on the right is the control point 3...



    control points view



    the black dot is the control point for t = 0.5



    and the difference in t for each colored dot is 0.1



    is the first image it's possible to notice that the highest point are exactly or very close to the yellow dot or in other words t = 0.4, in the center image the black dot is on the top (t = 0.5) and the last image the top is very close to the cyan dot (t = 0.6)...



    to find the position for each of these colored dots I'm using the formula..




    curvePoint = A *(1-t)^2 + B * 2t(1-t) + C * t^2




    where A = center of the first blue dot, B = center of the big red dot, C = last blue dot and and t goes from 0 to 1 in increments of 0.1...



    my question is, how to find out t mathematically? when I drag the big red dot the curve follows the control point but I have no idea what's the t value for the highest point in the given configuration...



    Is there any formula to find this value?
    I hope I was able to make myself clear



    thank you in advance for the answers!










    share|cite|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to find a the value of t exactly at the point where the curve stops going up an start going down, But I have no idea how to get this value I have the 3 control points values, the blue dot on the left is the control point 1, the big red dot is the control point 2 and the blue dot on the right is the control point 3...



      control points view



      the black dot is the control point for t = 0.5



      and the difference in t for each colored dot is 0.1



      is the first image it's possible to notice that the highest point are exactly or very close to the yellow dot or in other words t = 0.4, in the center image the black dot is on the top (t = 0.5) and the last image the top is very close to the cyan dot (t = 0.6)...



      to find the position for each of these colored dots I'm using the formula..




      curvePoint = A *(1-t)^2 + B * 2t(1-t) + C * t^2




      where A = center of the first blue dot, B = center of the big red dot, C = last blue dot and and t goes from 0 to 1 in increments of 0.1...



      my question is, how to find out t mathematically? when I drag the big red dot the curve follows the control point but I have no idea what's the t value for the highest point in the given configuration...



      Is there any formula to find this value?
      I hope I was able to make myself clear



      thank you in advance for the answers!










      share|cite|improve this question













      I need to find a the value of t exactly at the point where the curve stops going up an start going down, But I have no idea how to get this value I have the 3 control points values, the blue dot on the left is the control point 1, the big red dot is the control point 2 and the blue dot on the right is the control point 3...



      control points view



      the black dot is the control point for t = 0.5



      and the difference in t for each colored dot is 0.1



      is the first image it's possible to notice that the highest point are exactly or very close to the yellow dot or in other words t = 0.4, in the center image the black dot is on the top (t = 0.5) and the last image the top is very close to the cyan dot (t = 0.6)...



      to find the position for each of these colored dots I'm using the formula..




      curvePoint = A *(1-t)^2 + B * 2t(1-t) + C * t^2




      where A = center of the first blue dot, B = center of the big red dot, C = last blue dot and and t goes from 0 to 1 in increments of 0.1...



      my question is, how to find out t mathematically? when I drag the big red dot the curve follows the control point but I have no idea what's the t value for the highest point in the given configuration...



      Is there any formula to find this value?
      I hope I was able to make myself clear



      thank you in advance for the answers!







      curves bezier-curve






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Nov 19 at 16:12









      Lucas

      1




      1






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Sure. Let's call the curve point $P$ rather than "curvePoint"; we then want to know for what value of $t$ the $y$-coordinate of $P$ is largest. The good news is that the $y$-coord of $P$ depends only on the y-coords of $A, B,$ and $C$:
          $$
          P_y(t) = A_y (1-t)^2 + B_y 2t (1-t) + C_y t^2
          $$



          The function $P_y$ is defined on the interval $0 le t le 1$, and the max might occur at an endpoint, so we compute, right away,
          $$
          P_0 = A_y (1-0)^2 + B_y 2cdot 0 (1-0) + C_y 0^2 = A_y\
          P_1 = ldots = C_y
          $$

          Now as for the middle point, it must happen where the derivative with respect to $t$ is zero, i.e. where
          $$
          P_y'(t) = -2A_y (1-t) + 2B_y(1-t) + 2B_y t (-1) + 2C_y t = 0 \
          P_y'(t) = -2(1-t) (A_y - B_y) + 2t(C_y - B_y) \
          $$

          which is a linear bezier curve with control points that are (proportional to) the difference of $A$ and $B$ and the difference of $B$ and $C$. (I mention this because you may find it useful later).



          Setting to zero and simplifying to find the critical value of $t$, we can get rid of all the factors of 2 and combine terms to get
          $$
          newcommand{tstar}{{t_{*}}}
          $$

          begin{align}
          -2 (A_y - B_y) +2tstar (A_y - B_y) + 2tstar(C_y - B_y) &= 0 \
          -2 (A_y - B_y) +2tstar (A_y + C_y - 2B_y) &= 0 \
          tstar (A_y + C_y - 2B_y) &= (A_y - B_y) \
          tstar &= frac{A_y - B_y}{A_y + C_y - 2B_y }
          end{align}

          and we can use this value of $tstar$ to compute $P_2$, the height of the curve at the critical time $t$. We compare this to $P_0$ and $P_1$, and pick as our $t$-value either $0, 1,$ or $tstar$ accordingly.






          share|cite|improve this answer























            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            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',
            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%2f3005127%2fhow-to-calculate-the-value-of-t-for-the-highest-point-in-a-quadratic-bezier-cu%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Sure. Let's call the curve point $P$ rather than "curvePoint"; we then want to know for what value of $t$ the $y$-coordinate of $P$ is largest. The good news is that the $y$-coord of $P$ depends only on the y-coords of $A, B,$ and $C$:
            $$
            P_y(t) = A_y (1-t)^2 + B_y 2t (1-t) + C_y t^2
            $$



            The function $P_y$ is defined on the interval $0 le t le 1$, and the max might occur at an endpoint, so we compute, right away,
            $$
            P_0 = A_y (1-0)^2 + B_y 2cdot 0 (1-0) + C_y 0^2 = A_y\
            P_1 = ldots = C_y
            $$

            Now as for the middle point, it must happen where the derivative with respect to $t$ is zero, i.e. where
            $$
            P_y'(t) = -2A_y (1-t) + 2B_y(1-t) + 2B_y t (-1) + 2C_y t = 0 \
            P_y'(t) = -2(1-t) (A_y - B_y) + 2t(C_y - B_y) \
            $$

            which is a linear bezier curve with control points that are (proportional to) the difference of $A$ and $B$ and the difference of $B$ and $C$. (I mention this because you may find it useful later).



            Setting to zero and simplifying to find the critical value of $t$, we can get rid of all the factors of 2 and combine terms to get
            $$
            newcommand{tstar}{{t_{*}}}
            $$

            begin{align}
            -2 (A_y - B_y) +2tstar (A_y - B_y) + 2tstar(C_y - B_y) &= 0 \
            -2 (A_y - B_y) +2tstar (A_y + C_y - 2B_y) &= 0 \
            tstar (A_y + C_y - 2B_y) &= (A_y - B_y) \
            tstar &= frac{A_y - B_y}{A_y + C_y - 2B_y }
            end{align}

            and we can use this value of $tstar$ to compute $P_2$, the height of the curve at the critical time $t$. We compare this to $P_0$ and $P_1$, and pick as our $t$-value either $0, 1,$ or $tstar$ accordingly.






            share|cite|improve this answer



























              up vote
              0
              down vote













              Sure. Let's call the curve point $P$ rather than "curvePoint"; we then want to know for what value of $t$ the $y$-coordinate of $P$ is largest. The good news is that the $y$-coord of $P$ depends only on the y-coords of $A, B,$ and $C$:
              $$
              P_y(t) = A_y (1-t)^2 + B_y 2t (1-t) + C_y t^2
              $$



              The function $P_y$ is defined on the interval $0 le t le 1$, and the max might occur at an endpoint, so we compute, right away,
              $$
              P_0 = A_y (1-0)^2 + B_y 2cdot 0 (1-0) + C_y 0^2 = A_y\
              P_1 = ldots = C_y
              $$

              Now as for the middle point, it must happen where the derivative with respect to $t$ is zero, i.e. where
              $$
              P_y'(t) = -2A_y (1-t) + 2B_y(1-t) + 2B_y t (-1) + 2C_y t = 0 \
              P_y'(t) = -2(1-t) (A_y - B_y) + 2t(C_y - B_y) \
              $$

              which is a linear bezier curve with control points that are (proportional to) the difference of $A$ and $B$ and the difference of $B$ and $C$. (I mention this because you may find it useful later).



              Setting to zero and simplifying to find the critical value of $t$, we can get rid of all the factors of 2 and combine terms to get
              $$
              newcommand{tstar}{{t_{*}}}
              $$

              begin{align}
              -2 (A_y - B_y) +2tstar (A_y - B_y) + 2tstar(C_y - B_y) &= 0 \
              -2 (A_y - B_y) +2tstar (A_y + C_y - 2B_y) &= 0 \
              tstar (A_y + C_y - 2B_y) &= (A_y - B_y) \
              tstar &= frac{A_y - B_y}{A_y + C_y - 2B_y }
              end{align}

              and we can use this value of $tstar$ to compute $P_2$, the height of the curve at the critical time $t$. We compare this to $P_0$ and $P_1$, and pick as our $t$-value either $0, 1,$ or $tstar$ accordingly.






              share|cite|improve this answer

























                up vote
                0
                down vote










                up vote
                0
                down vote









                Sure. Let's call the curve point $P$ rather than "curvePoint"; we then want to know for what value of $t$ the $y$-coordinate of $P$ is largest. The good news is that the $y$-coord of $P$ depends only on the y-coords of $A, B,$ and $C$:
                $$
                P_y(t) = A_y (1-t)^2 + B_y 2t (1-t) + C_y t^2
                $$



                The function $P_y$ is defined on the interval $0 le t le 1$, and the max might occur at an endpoint, so we compute, right away,
                $$
                P_0 = A_y (1-0)^2 + B_y 2cdot 0 (1-0) + C_y 0^2 = A_y\
                P_1 = ldots = C_y
                $$

                Now as for the middle point, it must happen where the derivative with respect to $t$ is zero, i.e. where
                $$
                P_y'(t) = -2A_y (1-t) + 2B_y(1-t) + 2B_y t (-1) + 2C_y t = 0 \
                P_y'(t) = -2(1-t) (A_y - B_y) + 2t(C_y - B_y) \
                $$

                which is a linear bezier curve with control points that are (proportional to) the difference of $A$ and $B$ and the difference of $B$ and $C$. (I mention this because you may find it useful later).



                Setting to zero and simplifying to find the critical value of $t$, we can get rid of all the factors of 2 and combine terms to get
                $$
                newcommand{tstar}{{t_{*}}}
                $$

                begin{align}
                -2 (A_y - B_y) +2tstar (A_y - B_y) + 2tstar(C_y - B_y) &= 0 \
                -2 (A_y - B_y) +2tstar (A_y + C_y - 2B_y) &= 0 \
                tstar (A_y + C_y - 2B_y) &= (A_y - B_y) \
                tstar &= frac{A_y - B_y}{A_y + C_y - 2B_y }
                end{align}

                and we can use this value of $tstar$ to compute $P_2$, the height of the curve at the critical time $t$. We compare this to $P_0$ and $P_1$, and pick as our $t$-value either $0, 1,$ or $tstar$ accordingly.






                share|cite|improve this answer














                Sure. Let's call the curve point $P$ rather than "curvePoint"; we then want to know for what value of $t$ the $y$-coordinate of $P$ is largest. The good news is that the $y$-coord of $P$ depends only on the y-coords of $A, B,$ and $C$:
                $$
                P_y(t) = A_y (1-t)^2 + B_y 2t (1-t) + C_y t^2
                $$



                The function $P_y$ is defined on the interval $0 le t le 1$, and the max might occur at an endpoint, so we compute, right away,
                $$
                P_0 = A_y (1-0)^2 + B_y 2cdot 0 (1-0) + C_y 0^2 = A_y\
                P_1 = ldots = C_y
                $$

                Now as for the middle point, it must happen where the derivative with respect to $t$ is zero, i.e. where
                $$
                P_y'(t) = -2A_y (1-t) + 2B_y(1-t) + 2B_y t (-1) + 2C_y t = 0 \
                P_y'(t) = -2(1-t) (A_y - B_y) + 2t(C_y - B_y) \
                $$

                which is a linear bezier curve with control points that are (proportional to) the difference of $A$ and $B$ and the difference of $B$ and $C$. (I mention this because you may find it useful later).



                Setting to zero and simplifying to find the critical value of $t$, we can get rid of all the factors of 2 and combine terms to get
                $$
                newcommand{tstar}{{t_{*}}}
                $$

                begin{align}
                -2 (A_y - B_y) +2tstar (A_y - B_y) + 2tstar(C_y - B_y) &= 0 \
                -2 (A_y - B_y) +2tstar (A_y + C_y - 2B_y) &= 0 \
                tstar (A_y + C_y - 2B_y) &= (A_y - B_y) \
                tstar &= frac{A_y - B_y}{A_y + C_y - 2B_y }
                end{align}

                and we can use this value of $tstar$ to compute $P_2$, the height of the curve at the critical time $t$. We compare this to $P_0$ and $P_1$, and pick as our $t$-value either $0, 1,$ or $tstar$ accordingly.







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited Nov 20 at 0:31

























                answered Nov 19 at 16:29









                John Hughes

                61.6k24089




                61.6k24089






























                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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.


                    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%2f3005127%2fhow-to-calculate-the-value-of-t-for-the-highest-point-in-a-quadratic-bezier-cu%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

                    Bundesstraße 106

                    Verónica Boquete

                    Ida-Boy-Ed-Garten