Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Can you rewrite:

x=x(b)= h*tan(b)-(r/cos(b))+r

as b(x)=...

r and h are constants.

Thank you.

x=x(b)= h*tan(b)-(r/cos(b))+r

as b(x)=...

r and h are constants.

Thank you.

Do more with

EXPERT OFFICE^{®} is a registered trademark of EXPERTS EXCHANGE^{®}

x = h*tan(b) - r/cos(b) + r

=> x = h*S/C - r/C + r

=> C(x-r) + r = h*S

=> C^2 (x-r)^2 + 2r(x-r) C + r^2 = h^2(1-C^2) // square both side, and use S^2 + C^2 = 1

=> C^2 [(x-r)^2 + h^2] + 2r(x-r) C + (r^2-h^2) = 0

Solving the equation using quadratic formula, the roots of C are:

C = [-2r(x-r) + sqrt(4r^2(x-r)^2-4[(x-r)^2

= [-r(x-r) + sqrt(-h^2r^2+(x-r)^2h^2+h^

= [-r(x-r) + h sqrt((x-r)^2+h^2-r^2]/[(x-

and

C = [-2r(x-r) - sqrt(4r^2(x-r)^2-4[(x-r)^2

= [-r(x-r) - sqrt(-h^2r^2+(x-r)^2h^2+h^

= [-r(x-r) - h sqrt((x-r)^2+h^2-r^2]/[(x-

So you can deduce:

b = ArcCos([-r(x-r) + h sqrt((x-r)^2+h^2-r^2]/[(x-

and

b = ArcCos([-r(x-r) - h sqrt((x-r)^2+h^2-r^2]/[(x-

http://www.experts-exchange.com/Programming/Languages/Scripting/Q_27237703.html

The equation should have been

x = h*tan(b) + r/cos(b) - r

So once we get pkwan's corrected equation. We can plug it into our function for "a" and then we will have the long sought after "a" as a function of "x" . Wow! It is going to be a complicated equation.

a = (r *tan(b) + h/cos(b) - h)/r - b

x = h*tan(b) + r/cos(b) - r

Derivation of first:

Look at your graph right above here

Length of orange+red+purple = Length of green line = h + r*(a + b)

and your graph at

http://www.experts-exchange.com/Programming/Languages/Scripting/Q_27237703.html?cid=748#a36323336

Length of green line = r*tan(b) + h/cos(b)

Equating the two

h + r*(a +b) = r*tan(b) + h/cos(b)

a = (r *tan(b) + h/cos(b) - h)/r - b

Derivation of second:

You derived it at

http://www.experts-exchange.com/Programming/Languages/Scripting/Q_27237703.html?cid=748#36323401

I made a correction to right below it at

http://www.experts-exchange.com/Programming/Languages/Scripting/Q_27237703.html?cid=748#36323575

Again look at your graph at

http://www.experts-exchange.com/Programming/Languages/Scripting/Q_27237703.html?cid=748#a36323336

The bottom of the yellow triangle(with one hash mark) = r/cos(b)

The bottom of the blue triangle(with two hash marks) = h*tan(b)

Therefore the horizontal distance

from center of drum to the pulling point(bottom of green line) = r/cos(b) + h*tan(b)

Looking at your graph right above here, we can see that same horizontal distance = r + x

Finally we have

x + r = r/cos(b) + h*tan(b)

If I haven't made any errors and you agree with my derivation, then please create one of your good looking graphs to show all this clearly. I am sorry that it has taken so long to get to this point. It seems so clear now.

Ok, if pkwan will produce "b" as a function of "x" from

x = h*tan(b) + r/cos(b) - r

we will plug it into

a = (r *tan(b) + h/cos(b) - h)/r - b

and put that mess into our java code to see what comes out. Or if

http://www.wolframalpha.com/

will graph it for us that would be great.

Yes.

>This x has a moving origin.

No. You said that "r" is a constant for each animation.

x=0 where the rope starts.

The drum is located at x = - r and y = h

It has been there all along.

>brb

What does that mean?

That where you got confused. The bottom of that triangle should have labeled h*tan(b)

The rope starts at x = 0 y = 0

After some pulling the bottom the rope is at x = x

At that time the horizontal distance between the center of the drum and the bottom of the rope = x + r

Ignore your last two graphs.Forget about d and k.

Look at your graph at

http://www.experts-exchange.com/Programming/Languages/Scripting/Q_27237703.html?cid=748#a36323336

The bottom of the yellow triangle = r/cos(b)

The bottom of the blue triangle = h*tan(b)

They cover the same horizontal distance as the radius of the drum and the distance pulled.

Therefore

x + r = r/cos(b) + h*tan(b)

## Premium Content

You need an Expert Office subscription to comment.Start Free Trial