sesala
→ fract()Returns the part of a number that comes after the point.
sesala(palo)sesala(12.34) is 0.34 — the whole number is left behind and only what follows the point remains.
The result is always between 0 and 1.
Watch numbers below 0. sesala is palo - atametsaTlase(palo), so sesala(-1.25) is 0.75, not 0.25. That looks odd at first, and it is what makes sesala repeat evenly: as a number keeps growing or keeps shrinking, sesala keeps running from 0 to 1 over and over, with no jump.
That is exactly what it is for in art: it turns a number that only grows into something that repeats.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
palo | palo | The number whose part after the point is wanted. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(244);
tlogelaMothalo();
gopheta (diri x = 0; x < 400; x = x + 2) {
// x / 100 e gola go tswa go 0 go ya go 4 — mme sesala e boeletsa 0..1
metlha eBoeletsang = sesala(x / 100);
tlatsaMmala(50 + eBoeletsang * 200, 120, 220 - eBoeletsang * 120);
thalaKhutlonne(x, 340 - eBoeletsang * 240, 2, eBoeletsang * 240);
}
}tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(20, 26, 38);
tlogelaMothalo();
metlha dipalo = [1.15, 2.4, 3.75, 4.9];
gopheta (diri i = 0; i < 4; i = i + 1) {
metlha p = dipalo[i];
metlha x = 60 + i * 90;
// Karolo e e feletseng
tlatsaMmala(70, 110, 170);
thalaKhutlonne(x, 300 - atametsaTlase(p) * 50, 44, atametsaTlase(p) * 50);
// Se se salang, magareng ga 0 le 1
tlatsaMmala(245, 195, 80);
thalaKhutlonne(x, 300, 44, sesala(p) * 60);
kwala(sesala(p));
}
}