如何找到二次和三次贝塞尔曲线的真实点,t? [英] How to find quadratic and cubic bezier real points, t?
本文介绍了如何找到二次和三次贝塞尔曲线的真实点,t?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为二次和三次贝塞尔曲线计算 t ?
推荐答案
嗨 Saulius LT,zh
>>如何计算二次和三次贝塞尔曲线的t ?
您可以使用二次Bézier公式,例如,在维基百科页面上找到
BézierCurves。
$
在曲线上得到一个点,然后使用二次Bézier公式计算t值反向。
例如: 二次Bézier公式
x =(1 - t)*(1 - t)* p [0] .x + 2 *(1 - t)* t * p [1] .x + t * t * p [2] .x;
y =(1 - t)*(1 - t)* p [0] .y + 2 *( 1 - t)* t * p [1] .y + t * t * p [2] .y;
p [0]是起点,p [1]是控制点,p [2]是终点。 t是参数,从0到1。
以下链接供您参考。
在C#中手动绘制贝塞尔曲线
b
GraphDisplay:用于绘制函数和曲线的基于Bezier的控件
$
请尝试它是你自己并实现自己的细节。
最好的问候,
Yong Lu
Hi Saulius LT,
>>How to calculate t for quadratic and cubic beziers?
You can use the quadratic Bézier formula, found, for instance, on the Wikipedia page for Bézier Curves.
Get a point on the curve, then, use the use the quadratic Bézier formula to calculate the t value in reverse.
For example: quadratic Bézier formula
x = (1 - t) * (1 - t) * p[0].x + 2 * (1 - t) * t * p[1].x + t * t * p[2].x;
y = (1 - t) * (1 - t) * p[0].y + 2 * (1 - t) * t * p[1].y + t * t * p[2].y;
p[0] is the start point, p[1] is the control point, and p[2] is the end point. t is the parameter, which goes from 0 to 1.
The following links for your reference.
Draw a Bezier curve by hand in C#
GraphDisplay: a Bezier based control for graphing functions and curves
Please try it by yourself and implement your own details.
Best Regards,
Yong Lu
这篇关于如何找到二次和三次贝塞尔曲线的真实点,t?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文