Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Can we make the base of the exponent function a variable? #4

Closed
nickidlugash opened this issue Apr 3, 2014 · 2 comments
Closed

Can we make the base of the exponent function a variable? #4

nickidlugash opened this issue Apr 3, 2014 · 2 comments

Comments

@nickidlugash
Copy link
Contributor

What is the reason for the base of the exponent function being 1.75, instead of a variable? Would it make sense for it to be a parameter that the designer can change? If not, is there a way to make this constant explicit so the designer will be able to understand the function better?

From the style declaration:

function exponential(z_base, val, slope, min, max) {
    z_base = +z_base || 0;
    val = +val || 0;
    slope = +slope || 0;
    min = +min || 0;
    max = +max || Infinity;
    return function(z) {
        return Math.min(Math.max(min, val + Math.pow(1.75, (z - z_base)) * slope), max);
    };
}
@kkaefer
Copy link
Member

kkaefer commented Apr 4, 2014

Yes absolutely.

@mourner
Copy link
Member

mourner commented Apr 4, 2014

Agreed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants