计算贝塞尔曲线的中点 [英] Calculate middle point of Bezier Curve

查看:550
本文介绍了计算贝塞尔曲线的中点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有通过三个点绘制Bezier Curve的功能.我已经有2个点(起点和终点)-A和B.如何计算这两个点之间的中间点,因为中间点总是比这两个点的线性函数高一点或低一点.

I have a function to draw Bezier Curve through three points. I have already 2 points (start and end) - A and B. How do I calculate middle point between those two points as middle point would be always a little higher or lower than linear function of those two points.

示例:

任何公式,想法都很棒!

Any formulas, ideas would be great!

推荐答案

我认为这是您要寻找的:

I think this is what you're looking for:

http://blog.sklambert. com/查找贝塞尔曲线的控制点/

它详细介绍了计算贝塞尔曲线上的各个点.

It goes into detail on calculating the various points on a Bezier curve.

您可能也对这个更具体的示例感兴趣:

You may also be interested in this more specific example for your application:

http://www .codeproject.com/Articles/223159/Midpoint-Algorithm-Divide-and-Conquer-Method-for-D

如果您真的想了解它,那么我建议使用此入门手册:

If you really want to get into it, then I suggest this Primer:

http://pomax.github.io/bezierinfo/

贝塞尔曲线比简单弧稍微复杂一些.对于圆弧,您可以使用以下公式:

Bezier curves are a bit more complicated than simple arcs. For an arc, you can just use this formula:

R = H/2 + W^2/8H

...对于贝塞尔曲线绝对不起作用.例如,在二次贝塞尔曲线上,要计算一个点,必须使用:

...which definitely won't work for a Bezier curve. On a Quadratic Bezier curve, for example, to calculate a point, you must use:

来源: http://en.wikipedia.org/wiki/B%C3 %A9zier_curve 二次贝塞尔曲线:计算点

这篇关于计算贝塞尔曲线的中点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆