Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 515719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:39:24+00:00 2026-05-13T07:39:24+00:00

I need an exponential equation with the following parameters: When x = 0, y

  • 0

I need an exponential equation with the following parameters:

When x = 0, y = 153.
When x = 500, y = 53.
Y should increase exponentially as X approaches 0 and should decrease exponentially when X approaches 500.

For some reason I can’t remember how to do this.
I’m sure once I see the equation (or one similar) I can figure out the rest.

Context in Programming: This is for a Javascript function that changes the color of a div when a textarea’s max-length is about to be reached. Other alternatives or code snippets are very welcome.

UPDATE:
I don’t know why but -1500/(x+15)+153 gives me something close to what I am looking for. So It looks like what I was asking for is not what I really wanted.

I guess what I am looking for is:
When x = 0, y = 53.
When x = 500, y = 153.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:39:25+00:00Added an answer on May 13, 2026 at 7:39 am

    edit (after your update):

    With your changes, you’re asking for an ascending function and something resembling y = 1/x.

    The scale of your function can be changed to fit your exact coordinates, although the curve slopes much more steeply at the start.

    y = 154 – 10100 / (20 * x + 100) @ Wolfram Alpha
    Plot of 154 – 10100 / (20 * x + 100) from x=0 to x=500 @ Wolfram Alpha

    Noting the integer solutions, we make use of the solution x=96, y=149 to alter the formula, scaling these values into your coordinate range. This will give us something closer to your updated curve that slopes a little bit more gently.

    y = 158 – 2625 / (x + 25) @ Wolfram Alpha
    Plot of 158 – 2625 / (x + 25) from x=0 to x=500 @ Wolfram Alpha

    Here’s a plot of your version, for comparison.

    y = -1500 / (x + 15) + 153 @ Wolfram Alpha


    Original Answer (before your update)

    I think you will see some strange convergences towards your destination color if you use a non-linear scale, but nonetheless, you can use a general formula and decide what polynomial or exponent gives you the best results.

    First, the algebraic / polynomial function.

    A * X ^ N + B = Y
    

    This general formula can be solved in system to give you a polynomial of order N that fits a curve between two known points. In this case, we solve for <X = 0, Y = 153> to <X = 500, Y = 53>.

    Substituting the first coordinate pair, we easily obtain B.

    A * (0) ^ N + B = (153)
    0 + B = (153)
    B = 153
    

    Now, substituting the second pair, we can find A.

    A * (500) ^ N + 153 = (53)
    A * (500) ^ N = -100
    A = -100 / (500 ^ N)
    

    If you want a linear scale, you substitute N = 1, and that gives us A = -0.20 .

    -0.20 * X + 153 = Y
    

    If you want a quadratic scale, you substitute N = 2, and that gives us A = -0.0004 .

    -0.0004 * X ^ 2 + 153 = Y
    

    You could also use some non-integer value for N, between 1 and 2 (try 1.5 or 1.6), which I think will probably give you better results. Also note that as this function increases, it will eventually drop below zero, but only after the curve has passed through the second point.

    Here is the exponential function. I use e as the base here, although you could alter it to anything else greater than 1. To fit a curve between two points, we will get the best results if both points have Y values over zero. Otherwise, we would have to add an offset and determine where we want the baseline to be. For purposes here, we’ll assume the baseline is Y = 0. This means that as X increases, Y will eventually creep toward, but not actually reach, 0, after it has passed through the second point.

    A * e ^ (B * X) = Y
    

    Again, solve for the first coordinate.

    A * e ^ (B * 0) = 153
    A * e ^ (0) = 153
    A * 1 = 153
    A = 153
    

    Substitute in to get B, with the second coordinate.

    153 * e ^ (B * 500) = 53
    e ^ (B * 500) = 53 / 153
    B * 500 = ln(53 / 153)
    B = ln(53 / 153) / 500
    

    ln(val) is the natural log that is inverse to e ^ val. My calculator says that B is about equal to -0.0021202920156806272577911119053782, or perhaps -0.0021 would work best in short. If you want to solve this for other exponent bases, use exponent/logarithm identities in the same fashion to solve for any other base, and to change the base of the logarithm to ln() [log() in js] or log() [log() / Math.log10e in js].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to perform an exponential operation of two parameters (one set: t, and
For a simple simulation in C, I need to generate exponential random variables. I
Need some regular expressions help. So far I have my code working to allow
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need to set some attributes of button. For example Checked. I guess it is
I need to compute imaginary exponential in C. As far as I know, there
I have a requirement to convert the following types of decimal numbers to exponential
Can someone help me rewrite this regex to be non-exponential? I'm using perl to
I need to parse the string 1.2345E-02 (a number expressed in exponential notation) to
I need to write an application that will take a list of files (some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.