如何计算仅包含起点和终点的贝塞尔曲线? [英] How to calculate a bezier curve with only start and end points?

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

问题描述

我最初发布了一个更简单(且不太有用)的问题,并对其进行了编辑以使其更加具体.

I originally posted a much simpler (and less helpful) question, and have edited this to be more specific.

这个来自维基百科的动画基本上显示了我想要完成的事情,但是-我希望它能够翻转,在这里它开始向目标方向更多地前进并向上"(在此图像中),然后更直接地起弧到终点.但是,我只能访问起点和终点,我希望做的是能够通过指定高度"(或宽度,无论您要称呼什么)来确定其他点,以确定高度弧线实际上消失了. http://en.wikipedia.org/wiki/File:Bezier_3_big.png (由于重复率低而无法发布图片)

This animation from wikipedia shows basically what I want to accomplish, however - I'm hoping to have it flipped around, where it starts progressing more towards the destination and "up" (in this image), and then arcs more directly to the end point. However, I only have access to a starting point and ending point, what I am hoping to do is be able to determine the other points by specifying a "height" (or width, whatever you want to call it), to determine how high the arc actually goes. http://en.wikipedia.org/wiki/File:Bezier_3_big.png (can't post image due to low rep)

我希望能够调用一个具有起点和终点以及高度的函数,并使其返回沿曲线的所有点.

I would like to be able to call a function with the start and end points and a height, and have it return all the points along the way of the curve.

我们将向您提供帮助或指导.

Help or direction would be appreciated.

推荐答案

在不失一般性的前提下,假设终点在x轴上,起点在终点的上方和左侧.

Without loss of generality, suppose the ending point is on the x axis and the starting point is above and to the left of the ending point.

想象一下,起点在悬崖的顶部,终点在悬崖的底部.想象一下,您从起点水平地掷出一个球,这样重力就会将其拉下,从而准确地击中终点.

Imagine the starting point is at the top of a cliff, and the ending point is at the bottom of a cliff. Imagine you throw a ball horizontally from the starting point, such that gravity will pull it down so that it smacks exactly into the ending point.

该曲线似乎具有所需的属性.它开始变浅,然后随着球的加速而朝垂直方向增加.

That curve seems to have the properties you want. It starts shallow and then increases towards the vertical as the ball accelerates.

通过更改最初投球的角度,可以使曲线在开始时更浅.通过更改重力强度,您可以使其最终变得更陡峭.

By changing the angle at which you throw the ball initially you can make the curve more shallow at the beginning. By changing the strength of gravity you can make it more steep at the end.

那条曲线符合您的需求吗?找到那条曲线是一个非常基本的物理问题.

Does that curve fit your needs? Finding that curve is a pretty basic physics problem.

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

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