xxxxxxxxxx
67
var t = 0; //time
var sc = 300;
var n = [0];//x coords for input points
var o = [0];//y coords for input points
var ns = 0; //storage copy of the x coords while the original is being manipulated
function setup() {//setup
var x = 1;//ratio numerator
var y = 5;//ratio denominator
angleMode('radians');//makes sure everything is in radians
frameRate(60);//sets the uh... theoretical frame rate
createCanvas(1200, 1200);//makes the background
}
var n2 = 0;//x coords for output points
var o2 = 0;//y coords for output points
var e = 1;//x coord for first term in the möbius transform
var f = 3;//y coord for first term in the möbius transform
var g = -1;//x coord for first term in the möbius transform
var h = 0;//x coord for first term in the möbius transform
var j = 1;//x coord for first term in the möbius transform
var k = -2;//x coord for first term in the möbius transform
var l = 4;//x coord for first term in the möbius transform
var m = 0;//x coord for first term in the möbius transform
var p = 0;//variable for just like, compactness
var q = 0;//variable for just like, compactness
var r = 0;//variable for just like, compactness
var s = 0;//variable for just like, compactness
function draw() {
background(0,0,0);
var x = 1;
var y = 5;
var n = [0];
var o = [0];
var tuner = 5*PI/13/2;//why 5/13 works I haven't the foggiest, must be tuned for new values of x and y
strokeWeight(2);
stroke(0,255,0);
t+=0.1;
for(var i = -8; i<8; i+=1){
for(var j = -8; j<8; j+=1){
for(var k = -10; k<11; k++){
if(k%2==0){
n.push(/*t+((mouseX-600)/sc)/2+*/(1*(i+0.5)/y+(j+k/20+0.5)/x)*(tuner));
o.push(/*((mouseX-600)/sc)/2+*/(1*(i+0.5)/x-(t%(y*y+x*x)+j+k/20+0.5)/y)*(tuner));
}
else{
n.push(/*t+((mouseX-600)/sc)/2*/(1*(i+k/20+0.5)/y+(j+0.5)/x)*(tuner));
o.push(/*((mouseY-600)/sc)/2*/(1*(i+k/20+0.5)/x-(t%(y*y+x*x)+j+0.5)/y)*(tuner));
}//it took me about 6 hours+ to get this semi-worked out
ns=n[n.length-1];
point(600+ns*sc,600+o[o.length-1]*sc);
n[n.length-1] = pow(2.7182818,ns)*cos(o[o.length-1]);
o[o.length-1] = pow(2.7182818,ns)*sin(o[o.length-1]);
}
}
}
for(var i=0; i<n.length; i++){
stroke(255,0,0);
point(600+n[i]*sc,600+o[i]*sc);
p = n[i]*f+o[i]*e+h;
q = n[i]*k+o[i]*j+m;
r = n[i]*e+g-o[i]*f;
s = n[i]*j+l-o[i]*k;
n2 =((((r*s)+(p*q))/(sq(s)+sq(q))));//it took me about an hour to find an error in my math here, good gosh
o2 =((((p*s)-(r*q))/(sq(s)+sq(q))));
stroke(0,0,255);
point(600+n2*sc,600+o2*sc);
}
}