// Plastiq
// Rodrigo Balerdi
// Based on Opus Dei
// 1999-08-12

Durn="4",


CamX="60 * cos( -.07 * t )",
CamY="60 * sin( .05 * t )",
CamZ="5",

CmLX="1",
CmLY="0",
CmLZ="-29",

CUpX="0",
CUpY="0",
CUpZ="1",


// Window size and position
widt=590,heig=300,


ConL=1,
ConB=1,




A0="25",   // bounds XY size
A1=".8",   // Theta (ie, time) scale
A2=".08",  // deltaT
A3="a2 / 4",  // deltaT for dt
A4="-2",     // speed

B0="sin( .2 * t )",

// We use polar cords, and our eq will be "r = c0( theta )"
C0="a1 * st + dt * b0", // Theta( T )
C1="2 * ( 1.4 - .2 * sin( .31 * st ) -.3 * sin( .39 * st ) + .35 * cos( .44 * st ) )",
C2="( abs( c1 ) + .7 ) * cos( 1.9 * c0 + .8 * sin( .42 * st ) - .7 * sin( .32 * st ) )", 

// We compute (x+dx,y+dy) to calc velocity
C3="st + a2",  // T + deltaT
C4="a1 * c3 + dt * b0",  // Theta( T + deltaT )
C5="2 * ( 1.4 - .3 * sin( .31 * C3 ) -.4 * sin( .39 * C3 ) + .45 * cos( .44 * C3 ) )",
C6="( abs( c5 ) + .9 ) * cos( 1.9 * c4 + .8 * sin( .42 * C3 ) - .7 * sin( .32 * C3 ) )", 

C7="c2 * cos( c0 ) - a4 * dt",  // x
C8="c2 * sin( c0 )",  // y

C9="c6 * cos( c4 ) - a4 * ( dt + a3 ) - c7",   // dx  (unnormalized)
C10="c6 * sin( c4 ) - c8",  // dy  (unnormalized)

C11="a0 * 2.2 / (1.07 - dt) / sqrt( C9 * C9 + C10 * C10 )",

C12="a0 * c7",  // x  (scaled)
C13="a0 * c8",  // y  (scaled)

C14="c11 * c9",   // dx  (normalized and scaled)
C15="c11 * c10",  // dy  (normalized and scaled)

C16="20 * (1 - dt * dt)",

C17="c12 + .5 * c15",
C18="c13 - .5 * c14",

D0="fft(s)",

// x = r * cos( theta ), y = r * sin( theta )
// (- c15, c14) is perpendicular to path
X="c17 - s * c15",
Y="c18 + s * c14",
Z="D0 * c16",


//R="1 - fft( s ) - dt",
//G="3 * fft( s ) * ( 1 - dt * dt * dt )",
//B="3 * ( 1 + fft( s ) ) * ( 1 - dt ) * dt",

//LvlR=".6 + 2 * ( 1 - fft( s ) )",
//LvlG=".6 + 6 * fft( s )",
//LvlB=".6",

C19="1 - dt",
C20="3 * ( 1 - dt ^ 4)",
C21="3 * ( 1 - dt ) * dt",

R="c19 - D0",
G="c20 * D0",
B="c21 + c21 * D0",

LvlR="2.6 - 2 * D0",
LvlG=".6 + 6 * D0",
LvlB=".6",


Scal="400",
ScSz=1,

Pers="120",

Vers=40
