Results 1 to 7 of 7

Thread: [RESOLVED] Need a formula

  1. #1

    Thread Starter
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    Resolved [RESOLVED] Need a formula

    Hi all,
    I have a strange request, I need to calculate a formula based on the terms given.
    f(27.1864667) = 1.0
    f(24.6676333) = 2.0
    f(2.2479) = 10.9

    So I basically need to know what f(X) is. Any ideas ?

    EDIT: More info, This is to calculate score of a shooting target from the furthest point from the centre that the bullet hole made, all the rings are equally spaced so it should be linear equation.
    Last edited by BlindSniper; Oct 9th, 2011 at 02:15 AM.

    Useful CodeBank Entries of mine
    Expand Function
    Code Compiler
    Sudoku Solver
    HotKeyHandler Class

    Read this to get Effective help on VBForums
    Hitchhiker's Guide to Getting Help at VBF

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Need a formula

    There are infinitely many answers, though after plotting your data it is extremely close to linear. A linear least-squares regression gives

    f(x) = 29.7056 - 2.51906x

    courtesy of Wolfram Alpha.


    The residuals are extremely small, with magnitude less than 0.0001, so the fit is excellent.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: Need a formula

    @jemidiah: You mixed up your variables.

    Assuming a linear equation (y = mx + b), we can solve for the first two equations to find m = -0.39700919 and b = 11.793277. This result fits well with the third equation.

    f(x) = 11.793 - 0.397x

    f(27.1864667) = 0.9999727201
    f(24.6676333) = 1.999949699
    f(2.2479) = 10.9005837

  4. #4

    Thread Starter
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    Re: Need a formula

    The formula's result will be rounded to the first digit, which means it doesn't have to be exact. I am going to post more values later today and they will be more accurate.
    Last edited by BlindSniper; Oct 9th, 2011 at 02:07 AM.

    Useful CodeBank Entries of mine
    Expand Function
    Code Compiler
    Sudoku Solver
    HotKeyHandler Class

    Read this to get Effective help on VBForums
    Hitchhiker's Guide to Getting Help at VBF

  5. #5

    Thread Starter
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    Re: Need a formula

    Quote Originally Posted by Logophobic View Post
    @jemidiah: You mixed up your variables.

    Assuming a linear equation (y = mx + b), we can solve for the first two equations to find m = -0.39700919 and b = 11.793277. This result fits well with the third equation.

    f(x) = 11.793 - 0.397x

    f(27.1864667) = 0.9999727201
    f(24.6676333) = 1.999949699
    f(2.2479) = 10.9005837
    Your formula seems to be what I need . I will test it thoroughly and if it works I will be a very happy man.

    Useful CodeBank Entries of mine
    Expand Function
    Code Compiler
    Sudoku Solver
    HotKeyHandler Class

    Read this to get Effective help on VBForums
    Hitchhiker's Guide to Getting Help at VBF

  6. #6

    Thread Starter
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    Re: Need a formula

    I recalculated the values and then threw them at wolfram alpha and now I have a good working formula.
    Thanks guys.

    Useful CodeBank Entries of mine
    Expand Function
    Code Compiler
    Sudoku Solver
    HotKeyHandler Class

    Read this to get Effective help on VBForums
    Hitchhiker's Guide to Getting Help at VBF

  7. #7
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: [RESOLVED] Need a formula

    Hah, how silly of me. I'm sorry for the mix-up, though at least my link was useful.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width