thalaTlhakorenne
→ quad()Draws a four-sided shape from four points you choose.
thalaTlhakorenne(x1, y1, x2, y2, x3, y3, x4, y4)Where thalaKhutlonne and thalaSekwere give you fixed shapes, thalaTlhakorenne gives you four points — and you put them wherever you like. So you can draw a rectangle, a square, a rhombus or a trapezium, and any other four-sided shape besides.
Give the x and y of each point in order, going around the shape — clockwise or anticlockwise. Skip about and the sides will cross, turning the shape into a bowtie.
seeloSaKhutlonne does nothing here: points are points, not a width and a height, so there is no mode that could change how they are read.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
x1 | palo | First point x. |
y1 | palo | First point y. |
x2 | palo | Second point x. |
y2 | palo | Second point y. |
x3 | palo | Third point x. |
y3 | palo | Third point y. |
x4 | palo | Fourth point x. |
y4 | palo | Fourth point y. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(242);
tlatsaMmala(230, 150, 90);
boketeMothalo(3);
thalaTlhakorenne(140, 120, 260, 120, 320, 280, 80, 280);
}tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(140, 190, 240);
tlogelaMothalo();
// naga
tlatsaMmala(120, 170, 90);
thalaKhutlonne(0, 200, 400, 200);
// tsela: e bophara kwa tlase, e tshesane kwa kgakala
tlatsaMmala(70, 70, 78);
thalaTlhakorenne(60, 400, 340, 400, 215, 200, 185, 200);
// mela e mesweu e e mo bogareng
tlatsaMmala(250);
gopheta (diri i = 0; i < 6; i = i + 1) {
metlha t = i / 6;
metlha tGodimo = (i + 0.45) / 6;
metlha yTlase = lekanyetsa(t, 0, 1, 400, 200);
metlha yGodimo = lekanyetsa(tGodimo, 0, 1, 400, 200);
metlha bTlase = lekanyetsa(t, 0, 1, 9, 1.2);
metlha bGodimo = lekanyetsa(tGodimo, 0, 1, 9, 1.2);
thalaTlhakorenne(200 - bTlase, yTlase, 200 + bTlase, yTlase, 200 + bGodimo, yGodimo, 200 - bGodimo, yGodimo);
}
}