Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function logistic_chaos(r,x,n){
- if (isNaN(r) || r <0 || r > 4){
- throw "logistic_chaos: r has to be a number in between 0 and 4 (inclusive)! r="+r;
- }else if(isNaN(r) || x <0 || x > 1 ){
- throw "logistic_chaos: x0 has to be a number in between 0 and 4 (inclusive)! r="+r;
- }else if(isNaN(n) || n < 0) {
- for(let i = 0; i < n; i++){
- let newF = r*x*(1-x);
- document.writeln(newF+"<br>");
- x = newF;
- }
- }
- }
- logistic_chaos(2, 0.3, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement