Results 1 to 3 of 3

Math Help - Logarithmic Interpolation

  1. #1
    Newbie
    Joined
    Mar 2010
    Posts
    2

    Logarithmic Interpolation

    I知 trying to interpolate on a logarithmic scale for a program I知 working on and have been banging my head against the desk trying to develop a formula for this and I知 hoping maybe someone either already has one or can give me some assistance. The entire graph is situated in an arbitrary coordinate system (it痴 displayed on a screen, so the coordinate system is the x,y pixel coordinates.) So I know the screen coordinates of the two points and the real values of these points (what they user tells the program they are). Now I need to find the corresponding real value of a new point that is placed on the graph when I only know the screen coordinates.

    Ex: The graph below, I would know the value of the red squares but do not know the value of the green square, but I know the "coordinates" of each. The X-axis is logarithmically scaled.

    Further expanded example with numbers:
    Say the left red square is at 100 pixels and represents a value of 1.
    The right red square is at 500 pixels and represents 10.
    The green square is at 200 pixels and I need to find it's value.

    Follow Math Help Forum on Facebook and Google+

  2. #2
    Junior Member
    Joined
    Mar 2008
    Posts
    61
    Quote Originally Posted by bceros View Post
    I知 trying to interpolate on a logarithmic scale for a program I知 working on and have been banging my head against the desk trying to develop a formula for this and I知 hoping maybe someone either already has one or can give me some assistance. The entire graph is situated in an arbitrary coordinate system (it痴 displayed on a screen, so the coordinate system is the x,y pixel coordinates.) So I know the screen coordinates of the two points and the real values of these points (what they user tells the program they are). Now I need to find the corresponding real value of a new point that is placed on the graph when I only know the screen coordinates.

    Ex: The graph below, I would know the value of the red squares but do not know the value of the green square, but I know the "coordinates" of each. The X-axis is logarithmically scaled.

    Further expanded example with numbers:
    Say the left red square is at 100 pixels and represents a value of 1.
    The right red square is at 500 pixels and represents 10.
    The green square is at 200 pixels and I need to find it's value.
    Believe it or not but about 15 years ago I had exactly the same problem. I derived the formula after an hour of mistakes and swearing at myself, so I know how you feel. I wrote the result down in my personal formula book and here it is. Call the screen coordinates S1, S2 and S as the left red, right red and green dot's coordinates. Also call the respective values of them X1, X2 and X. The connection is now:

    \frac{log(X)-log(X_1)}{log(X_2)-log(X_1)}=\frac{S-S_1}{S_2-S_1}

    As you can see it is a fairly simple linear relationship between the screen coordinates and the logarithm of the values. In the example you gave the value is 1.777... if I did not make a mistake :-) Have fun with the programming.

    Coomast
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Mar 2010
    Posts
    2
    Thank you very much! That is working great!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. interpolation
    Posted in the Number Theory Forum
    Replies: 0
    Last Post: November 29th 2010, 12:59 PM
  2. Interpolation
    Posted in the Calculus Forum
    Replies: 1
    Last Post: March 21st 2010, 05:43 AM
  3. Interpolation
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: October 13th 2009, 11:20 PM
  4. Interpolation
    Posted in the Algebra Forum
    Replies: 4
    Last Post: July 27th 2009, 07:06 PM
  5. Interpolation
    Posted in the Calculus Forum
    Replies: 0
    Last Post: April 2nd 2009, 02:16 PM

Search Tags


/mathhelpforum @mathhelpforum