tterrag1098

Untitled

Oct 10th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /**
  2. * This class represents a <a href="https://en.wikipedia.org/wiki/Logistic_function">logistic growth curve</a>, for use in physics calculations where a value chages logarithmically over time.
  3. */
  4. public class LogisticGrowthCurve {
  5.  
  6. private final double capacity, a, b;
  7.  
  8. public LogisticGrowthCurve(double capacity, double a, double b) {
  9. this.capacity = capacity;
  10. this.a = a;
  11. this.b = b;
  12. }
  13.  
  14. public double get(double x) {
  15. return capacity / (1 + Math.exp(a + (b * x)));
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment