英文:
Cubic bezier curve that pass through 3 points
问题
有以下几个点:
- P0(左上角)
- P3(右下角)
- 控制点 - 可以移动的点,曲线应通过它
我需要使用三次曲线将它们连接起来,以便曲线的末端是“大致水平的”,并且还可以移动控制点
所以我将P2放在坐标P0.x P3.y上(也许这是错误的决定)
现在我需要计算P1,使曲线通过控制点
我看到了一个很好的示例,使用了二次曲线
https://stackoverflow.com/a/66463100/20852881
之前我使用了这个示例中的二次曲线,但是现在需要使曲线的末端“大致水平”(对于这样的排列P0(左上角)和P3(右下角)),所以我转向了三次曲线
英文:
There are points:
- P0 (left-top)
- P3 (right-bottom)
- Control Point - a point that can be moved, a curve should pass through it
I need to connect them using a cubic curve, so that the end of the curve is 'approximately horizontal' and it is also possible to move the Control Point
So I put P2 on the coordinates P0.x P3.y (maybe this is the wrong decision)
Now I need to calculate P1 so that the curve passes through the Control Point
I saw a good example with a quadratic curve
https://stackoverflow.com/a/66463100/20852881
Earlier i used the quadratic curve from this example, however, it became necessary to make the end of the curve 'approximately horizontal' (for such an arrangement P0 (left-top) and P3(right-bottom))
, so I look towards the cubic curve
答案1
得分: 0
这是我的Solid.js解决方案,基于文章1和主要参考文章2。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论