Quadratic Bezier Curve: Calculate Tangent

别说谁变了你拦得住时间么 提交于 2019-12-07 05:21:01

问题


I have a quadratic bezier curve and I want to calculate the slope of the tangent in a given point. For example, let it be the middlepoint of the quadratic bezier curve, therefore t=0.5 (please see the link below for a picture of this). I've calculated the first derivative of the formula for the quadratic bezier curve; however I get 400 as value for the slope, though it should be 0. Maybe I'm using the first derivative in a wrong way? I know I could also calculate the tangents using trigonometric functions; however I'd like to do it using the first derivative, shouldn't this be possible? Thanks for any hint!

For clarification / please note: I'm interested in a general way to get the slope in a arbitrary given point on a quadratic bezier curve, not only to get the tangent in the start- and end point.

A picture of my problem including the text above: http://cid-0432ee4cfe9c26a0.skydrive.live.com/self.aspx/%c3%96ffentlich/Quadratic%20Bezier%20Curve.pdf

Thank you very much for any hint!


回答1:


Using your formula for B'(t), evaluated at t=1/2, we get

B'(1/2) = -P0 + P2

From the look of your graph, P0 = (0,0) and P2 = (400,0). So

B'(1/2) = (400,0).

This is the "velocity" of a point traveling along B(t) at t=1/2.

(400,0) is a horizontal vector, with magnitude 400.

So all is as it should be. Since B'(t) is horizontal, it does have "slope" 0.




回答2:


Derivatives of a Bézier Curve



来源:https://stackoverflow.com/questions/2569593/quadratic-bezier-curve-calculate-tangent

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!