Accueil › Forums › Scripts › Chaos Scripts › Re: Chaos Scripts
Sorry for the lateness of my response. I am still interested in learning how to do this. Here is my code:
//Script « Lorenz Graph »
//Insert requests for global variables:
function onConfigure() {
title(« Lorenz attractor »);
ask(« General », « initial x », « xo », 0);
ask(« General », « initial y », « yo », 0);
ask(« General », « Initial z », « zo », 0);
ask(« Parameters », « sigma », « s », 10);
ask(« Parameters », « beta », « b », 2.66666);
ask(« Parameters », « row », « p », 28);
ask(« Euler », « Delta t », « dt »,.01);
ask(« Euler », « Number of Steps », « r », 10);
var x = xo;
var y = yo;
var z = zo;
var i;
}
//Insert code to create score:
function onCreate() {
run(« clear »);
run(« zoom 100 »);
run(« center 0 0 »);
run(« rotate 0 0 0 »);
run(« registerTexture background 0 0 0 0 ./Tools/background.jpg »);
//Add curve
run(« add curve 1001 »);
run(« setPos current » + xo + » » + yo + » » + zo);
run(« setPointAt current 0 » + xo + » » + yo + » » + zo);
for(var index = 0; index <= r; index++)
{
i = index;
//evaluate Euler method
x = xo + ( s * ( y – x )) * dt;
y = yo + ( x* ( p – z ) – y ) * dt;
z = zo + ( x * y – b * z ) * dt;
//create line at xo, yo, zo to x, y, z
DrawEul(x, y, z);
//set new initial values
xo = x;
yo = y;
zo = z;
}
run(« add cursor 1 »);
run(« setCurve current lastCurve »);
run(« setSpeed current auto 100 »);
}
//Custom function
function DrawEul(ex, wy, ze) {
//run(« setPointAt current pNum » + exo + » » + wyo + » » + zeo);
run(« setPointAt current pNum » + ex + » » + wy + » » + ze);
}
© IanniX Association
Qu'est-ce que IanniX ? | Téléchargement | Showcase | Forum | Recherche | À propos
Cookie | Durée | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |