xxxxxxxxxx
67
let textString = "خوارزمية";
let letters = [];
let sizes = [];
let angle = 0;
function setup() {
createCanvas(600, 600);
textAlign(CENTER, CENTER);
textSize(30);
textFont('monospace'); // Using a pixel-like font
letters = shuffle(textString.split('')); // Shuffle the letters
noLoop();
}
function draw() {
background(255);
let x = width / 2;
let y = height / 2;
for (let i = 0; i < letters.length; i++) {
let randomAngle = random(TWO_PI);
sizes.push(abs(tan(randomAngle)) * 50);
// let letterSize = random(50, 300); // Random size for each letter
textSize(sizes[i]);
fill(random(255),random(255),random(255),200);
text(letters[i], x + (i - letters.length / 2) * 50, y); // Position letters
}
// Set the font and size for the first text
textSize(9);
textFont('Impact');
fill(0);
text('Diophantine \nEquation', width / 2.8, height / 2 - 40 );
push();
// Set the font and size for the first text
textFont('monospace');
textAlign(LEFT,LEFT);
text('By the Euclidean algorithm we find \n60 = 1∙33 + 27 33 \n= 1∙27 + 6 27 \n= 4∙6 + 3 6 \n= 2∙3 + 0. \nWe see the last nonzero remainder is 3 \nso gcd(60, 33) = 3. As 3|9, the equation has integer solutions.', 150,323)
pop();
// Set the font and size for the second text "م"
textSize(500);
textFont('impact');
fill(0,0,0);
text('هـ', width / 2, height / 3 );
//function draw() {
// Set the font and size for the second text "ax+by=c"
translate( 0, height - 50);
rotate(-HALF_PI);
textSize(100);
fill(random(255), random(255), random(255), 200);
text('ax+by=c', x, y);
push();
textSize(9);
textFont('monospace');
fill(0, 0, 0, 200);
text('Solve the linear Diophantine equation:60x + 33y = 9.', 410, 252);
pop();
}