Link to home
Start Free TrialLog in
Avatar of kacor
kacorFlag for Hungary

asked on

Formula of a line in log-log coordinate system going through P1 and P2

Hi Experts,

earlier I asked a similar question see

https://www.experts-exchange.com/questions/21183266/Formula-of-a-line-in-log-log-coordinate-system.html#12444220

But now my question is: what is the formula of a line in log-log coordinate system going through P1(X1;Y1) and P2(X2;Y2) because I've tried to solve it but I was unsuccesful. Thanks for your help!

Janos
Avatar of d-glitch
d-glitch
Flag of United States of America image

Sorry we weren't clearer last time.

The equation of a straight line on a log-log plot must have the form:

               Y  =  Ao * X^m  

From the earlier question we have:

      m   = log (Y2/Y1)/log(X2/X1))


                       Y1            Y2
     Ao    =   ---------   =  --------
                    X1^m         X2^m
Avatar of kacor

ASKER

thanks d-glitch I'll test it.

wbr Janos
If you believe
                          Y  =  Ao * X^m        

Then you have two equations in two unknowns:

                         Y1  =  Ao * X1^m

                         Y2  =  Ao * X2^m

You can solve either one or both to find Ao in terms of X,Y, and m

                                        Y1            Y2
                       Ao    =   ---------   =  --------
                                     X1^m         X2^m

You can use the second equality (which has eliminated Ao) to solve for m in terms of X and Y.

                            Y1            Y2
                        ---------   =  --------
                         X1^m         X2^m

You did this yourself in the earlier question:

                                 m   = log (Y2/Y1)/log(X2/X1))
ASKER CERTIFIED SOLUTION
Avatar of d-glitch
d-glitch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kacor

ASKER

thanks that's right
Avatar of thanasis57
thanasis57

In a normal plot, the equation for a straight line is:
y=a*x+b

In a log-log plot it will be:
logy=a*logx+b =>
y=10^(a*logx+b) =>
y=10^(a*logx)*10^b =>
y=(10^logx)^a*10^b => (because if y=logx <=> x=10^y=10^logx)
y=x^a*10^b

Thus, this function will give a linear graph in a log-log plot
In a normal plot, the equation for a straight line is:
y=a*x+b

where a=(Y2-Y1)/(X2-X1) (the slope) and b=(X1*Y2-X2*Y1)/(X1-X2) (intersection with y-axis)

In a log-log plot it will be:
logy=a*logx+b =>
y=10^(a*logx+b) =>
y=[10^(a*logx)]*(10^b) =>
y=[(10^logx)^a]*(10^b) => (because if y=logx <=> x=10^y=10^logx)
y=(x^a)*(10^b)

Thus, this function will give a linear graph in a log-log plot
Avatar of kacor

ASKER

HI,

I tried to get the needed equation but my trying was unsuccesful when I used the above said:

For example there are taken 2 points:

Point 1: y1=10;  x1=4,1
Point 2: y2=0,1; x2=176

I tried to insert the values.

the slope is m = log (Y2/Y1)/log(X2/X1))   =>  

m = log10(0,1/10) / log10(176/4)          m = -2 / 1,632729 = -1,224943

the intersection point with y-axis is b = y1 / x1^m

b = 10 / 4,1^(-1,224943) = 10 / 0,177572 = 56,31517

and using the equation of y=(x^a)*(10^b)  = 3,7E+55  I've got a bad value.

but using the equation of y = b * (x^a) the results are OK.

thanks for your support

Janos