Skip to content
ExamplesOpen editor ↗

tsenya

→ applyMatrix()

Applies six numbers that describe a transformation, in one go.

tsenya(a, b, c, d, e, f)

sutisa, dikolosa and godisa all do one job underneath: they multiply every point on the canvas by a table of numbers. That table is called a matrix in English — no Setswana word is used in its place, so Bopa names this function after what it does: it puts the numbers in.

The six numbers are a, b, c, d, e, f, and they do this:

  • a and d scale sideways and vertically — tsenya(2, 0, 0, 2, 0, 0) is the same as godisa(2).
  • e and f move — tsenya(1, 0, 0, 1, 50, 20) is the same as sutisa(50, 20).
  • b and c slant.

You will rarely need this: sutisa, dikolosa and godisa are easier to read and do the same things. It is here so you can apply several transformations at once.

Like every other transformation it accumulates, and is reset at the start of tshwantsha. Use simololaGape to wipe them all.

NameTypeDescription
apaloScale sideways.
bpaloSlant vertically.
cpaloSlant sideways.
dpaloScale vertically.
epaloMove sideways.
fpaloMove vertically.
Six numbers doing what `sutisa` and `godisa` do
tiro setaLoeto() {
  thalaKanefase(400, 400);
  bokamorago(238);
  tlogelaMothalo();

  // ka sutisa le godisa
  baya();
  sutisa(110, 200);
  godisa(1.5);
  tlatsaMmala(220, 120, 110);
  thalaSekwere(-40, -40, 80);
  tsaya();

  // ka dipalo tse thataro — popego e e tshwanang tota
  baya();
  tsenya(1.5, 0, 0, 1.5, 290, 200);
  tlatsaMmala(110, 170, 220);
  thalaSekwere(-40, -40, 80);
  tsaya();
}

simololaGape, sutisa, godisa, sekamisaX, baya