https://github.com/bjornstar/growth-curve
https://github.com/bjornstar/growth-curve
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bjornstar/growth-curve
- Owner: bjornstar
- License: mit
- Fork: true (Wizcorp/growth-curve)
- Created: 2013-11-15T08:06:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-09T09:41:48.000Z (over 11 years ago)
- Last Synced: 2024-04-15T12:19:29.490Z (about 1 year ago)
- Language: JavaScript
- Size: 134 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/bjornstar/growth-curve)
growth-curve
============Calculate compound growth with inflection points.
Example:
```javascript
var GrowthCurve = require('growth-curve');var killerGrowth = new GrowthCurve({ "1": 1.02, "5": 1.10, "25": 1.20, "46": 2 });
var healthAt47 = gentleGrowth.growTo(100, 47);
var rateAt33 = gentleGrowth.getRate(33); // returns 1.2
```###Constructor
####new GrowthCurve( *inflectionPoints* )
**inflectionPoints** is an object with rules governing the compound rates at the iterations where
they change.###Methods
####growTo( *initial*, *target* );
Returns the value of **initial** after it has been compounded **target** number of times with
changes to the rate set according to the rules given in the constructor.#####getPoint( *target* );
Returns the point that the growthCurve would use at the **target** iteration.#####getRate( *target* );
Returns the rate that the growthCurve would use at the **target** iteration.