Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America

asked on 

x(b) ... a(x,b) ... to give a(x)

I have following two equations (r and h are constants):

x=x(b)=r (cos(b)+ tan(b)sin(b)-1)+ tan(b)h                   (eq. 1)
a =a(x,b)= (1/r)*sqrt((h + rsin(b))^2 + (x + r - rcos(b))^2) - b-h/r               (eg. 2)    

to make it readable, if we assume S=Sin(b), C=Cos(b), and T=tan(b), then we get:

x=x(b)=r (C+ TS -1)+ Th      <-- these forms may be useful may be not
a =a(x,b)= (1/r)*sqrt((h + rS)^2 + (x + r - rC)^2) - b-h/r;

I want to have the following functions if possible:

a(x)=....?            (eq. 3)
b(x)=....?           (eq. 4)   <-- this one is not that important.      

Question:  Is it possible to find a(x) and b(x) having (eq. 1) and (eq. 4) above?

for background discussions please see: https://www.experts-exchange.com/questions/27237703/Animation-help-2.html

Thank you
Math / Science

Avatar of undefined
Last Comment
Mike Eghtebas
Avatar of TommySzalapski
Flag of United States of America image

What is b(x)? I don't see b shown as a function anywhere.
Also, if a is defined as taking two parameters then how do you drop one? How do you get from a(x,b) to just a(x)? The only way I could think of where that would make sense would be if b cancelled out of the equation, but it's not going to.

We need a lot more info before we can answer this question.
Avatar of Mike Eghtebas


re:> What is b(x)? I don't see b shown as a function anywhere

lets ignore b(x).  But, if we had it in a much simpler form say x=rcos(b) then

b=ArcCos(x/r)    and now we have b(x)=ArcCos(x/r)

re:> Also, if a is defined as taking two parameters then how do you drop one? How do you get from a(x,b) ...

This is why I am posting the question here hoping someone familiar with chain function possibly could come up with the answer.

Avatar of Peter Kwan
Peter Kwan
Flag of Hong Kong image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Okay I get it. So b(x) actually is important because you replace b in the a(x,b) equation with b(x). I've never seen equations expressed as functions, but it makes sense.

I verified pkwan's math and it looks good. He used the trig identities S^2 + C^2 = 1 and S/C = T to derive eq 6 and the quadratic formula to derive eqs 7 and 8. The rest is just pretty simple algebra. Very well done.

Don't forget that when you introduce an ArcCos, you need to constrain the domain.
Avatar of phoffric

When x = 0, a should be 0...

>> x = 10 (cos(b)+ tan(b)sin(b)-1)+ tan(b)60
   When b = 0, then x is 0 and vice-versa


>> a(0,b) = (1/10)*sqrt((60 + 10sin(b))^2 + (0 + 10 - 10cos(b))^2) - b-60/10
     When b and x are 0, a is 0

But, ...
>> a = (1/r)*sqrt((x+r)^2+h^2-r^2) -h/r - ArcCos([r(x+r) -  h sqrt(-r^2+(x+r)^2+h^2)] / [(x+r)^2+h^2]) ... (eq. 11)

So, for equivalency, if x = 0, then a should be 0, but..



On another note, not related to this question, when looking at the graphs, it appears that the relationship between a and b is suspect, since for large x, then a small change in b should result in a large change in a. See related question: http://rdsrc.us/qNFw9P
Avatar of Mike Eghtebas


Hi pkwan,

Thank you for the solution. I included the functions in a java program shown below to test the equations.

At x=0, I was expecting to get zero for both a and b, but I am getting:

angle a       angel b    x
 -02.81  02.81  00.00
 -02.79  02.80  00.25
 -02.78  02.80  00.50

 -00.01  02.26  23.75
 00.03  02.25  24.00
 00.07  02.25  24.25
 00.11  02.25  24.50
 00.15  02.24  24.75
 00.19  02.24  25.00

 06.26  01.94  59.50
 06.30  01.93  59.75

Most likely this dicrepency is due to my mistkes converting from your math equation to java equations shown below:

I will go over it to locate my mistakes.
import java.text.DecimalFormat;
public class Data1 {
  public static void main(String args[]) {
      DecimalFormat df = new DecimalFormat("00.00");
      double h = 30;
      double r = 5;
      double a = 0;
      double b = 0;
      System.out.println("angle a\t angel b    x");
      for(double x = 0; x < 60; x +=0.25){
//b = ArcCos([r(x+r) +  h sqrt(-r^2+(x+r)^2+h^2)] / [(x+r)^2+h^2]) ................... (eq. 7)
          b = Math.acos((r*(x+r) -  h*Math.sqrt(-Math.pow(r,2)+Math.pow((x+r),2)+
                  Math.pow(h,2))) / (Math.pow((x+r),2)+Math.pow(h,2)));
// a = (1/r)*sqrt((x+r)^2+h^2-r^2) -h/r - ArcCos([r(x+r) -  h sqrt(-r^2+(x+r)^2+h^2)] / [(x+r)^2+h^2]) ... (eq. 11)
//          System.out.println(" " + df.format(a*(180/Math.PI)) + "  " + df.format(b*(180/Math.PI)) + "  " + df.format(x));
          System.out.println(" " + df.format(a) + "  " + df.format(b) + "  " + df.format(x));

Open in new window

Avatar of Mike Eghtebas


Hi phoffric,

I didn't see your post.
Avatar of Mike Eghtebas


I should have used:

x=x(b)=r (cos(b)+ tan(b)sin(b)-1)+ tan(b)h                   (eq. 1)

a = (r *tan(b) + h/cos(b) - h)/r - b                                 (eg. 2) much simpler

x = r (C+T S -1)+T/h                                                       (eq. 1a)
a = (r T + h/C - h)/r - b                                                   (eg. 2a)

now will try the solution from pkwan on these two equations,

Avatar of Mike Eghtebas



I wonder if you have some time to take a look at this:


Thank you,

Math / Science
Math / Science

The Math / Science topic primarily includes discussions of mathematics, physics, statistics and economic analysis, but also biology, chemistry and other sciences.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo