Wednesday 15 June 2011

math - Given f(x) linear function, how to obtain a Quadratic Bezier control point -


I am doing a lot of research on this subject and I have received some posts where helpful but I just do not have the right Not received.

I am developing a very simple structural analysis application. In this app I have to show a graph showing the inner stress of the beam. The graph is obtained by the formula:

  y = (100 * x / 2) * (L x)   

Where L x 0 and the beam length is. Then the final formula will be:

  y = (100 * x / 2) * (1 - x) where 0 & lt; X & LT; 1.   

My starting and end points are assuming p0 = (0,0) and p2 = (1,0) . How do I get P2 (control point) ?? I am searching on the Wikipedia page but how can I get the control point from the Quadatic Bizier Curve Formula:

  B (t) = (1 - t) ^ 2 * P0 + 2 * ( 1 - t) * t * p1 + t ^ 2 * p2   

I'm sure this will be so easy to fix ?? | Can anyone help me?

PS: I also found that, what I am trying to achieve, I explain to the contrary. I do not understand how to walk it.

We want the crossstratial curve < B (t) . X = 0.5 between multiple points that match the code> Y to match the quadratic Bijier curve defined by

. When x = 0.5 ,

  y = (100 * x / 2) * (1 - x) 100 1 25 y = ---- * ---   

Therefore, let's B (0.5) = (0.5, 12.5) :

  Code> B (t) = (1-t) ^ 2 * (0,0) + 2 * (1-t) * t * (px, pi) + t ^ 2 * (1.0) (0.5, 12.5 ) = B (0.5) = (0,0) + 2 * (0.5) * (0.5) * (Px, PE) + (0.25) * (1.0) 0.5 = 0.5 * PX + 0.25 12.5 = 0.5  

= (0.5, 25)

And there is a visual confirmation (in Python) that we have found the right point:

  # import_pip import matlotlib.pyplot as plt import numpy np x = Np.linspace (0, 1, 100) y = (100 * x / 2) * (1-x) t = np.linspace (0, 1, 100) p0 = np.array ([0,0]) P1 = n P.array ([0.5,25]) P2 = NP. Array ([1,0]) B = ((1-T) ** 2) [,: NP. Envexis] * p + 2 * ((1-t) * t) [,: NP. Ennexis] * P1 + (T ** 2) [:, NP. Envexis] * P2 plat. Plot (X, Y) Plt.plot (b [:, 0], b [:, 1]) plt.show ()   

is running dragon test.py , we see two curves overlap:

enter image details here

How do I find out how to select the t = 0.5 parameter value when B (t) its max. Reaches the height?

Well, it was primarily based on intuition, but there is a more formal way to prove it:

B '(t) Y-component is equal to 0 when b (t) reaches its maximum height, therefore, due to the derivation of b , we

  0 = 2 * (1-2t) * pet tt = 0.5 or pe = 0   

if PE = 0 then B (t) (0,0) ) Is a horizontal line up to (1.0). Dismissing the case of this downfall, we reach the B (t) ceiling when t = 0.5 .

No comments:

Post a Comment