Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Peano-curve/Processing/peano-curve.processing
Normal file
25
Task/Peano-curve/Processing/peano-curve.processing
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//Abhishek Ghosh, 28th June 2022
|
||||
|
||||
void Peano(int x, int y, int lg, int i1, int i2) {
|
||||
|
||||
if (lg == 1) {
|
||||
ellipse(x,y,1,1);
|
||||
return;
|
||||
}
|
||||
|
||||
lg = lg/3;
|
||||
Peano(x+(2*i1*lg), y+(2*i1*lg), lg, i1, i2);
|
||||
Peano(x+((i1-i2+1)*lg), y+((i1+i2)*lg), lg, i1, 1-i2);
|
||||
Peano(x+lg, y+lg, lg, i1, 1-i2);
|
||||
Peano(x+((i1+i2)*lg), y+((i1-i2+1)*lg), lg, 1-i1, 1-i2);
|
||||
Peano(x+(2*i2*lg), y+(2*(1-i2)*lg), lg, i1, i2);
|
||||
Peano(x+((1+i2-i1)*lg), y+((2-i1-i2)*lg), lg, i1, i2);
|
||||
Peano(x+(2*(1-i1)*lg), y+(2*(1-i1)*lg), lg, i1, i2);
|
||||
Peano(x+((2-i1-i2)*lg), y+((1+i2-i1)*lg), lg, 1-i1, i2);
|
||||
Peano(x+(2*(1-i2)*lg), y+(2*i2*lg), lg, 1-i1, i2);
|
||||
}
|
||||
|
||||
void setup(){
|
||||
size(1000,1000);
|
||||
Peano(0, 0, 1000, 0, 0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue