calculating parameters for defining subsections of quadratic bezier curves

后端 未结 2 1423
迷失自我
迷失自我 2021-01-03 04:06

I have a quadratic bezier curve described as (startX, startY) to (anchorX, anchorY) and using a control point (controlX, controlY).

I have two questions:

(1)

2条回答
  •  再見小時候
    2021-01-03 04:20

    The t equation is wrong, you need to use eq(1)

    (1) x = (ax-2bx+cx)t2+2(bx-ax)t + ax
    

    and solve it using the the quadratic formula for the roots (2).

               -b ± √(b^2 - 4ac)
      (2)  x = -----------------
                  2a
    

    Where

    a = ax-2bx+cx
    b = 2(bx-ax)
    c = ax - x
    

提交回复
热议问题