Skip to content
ExamplesOpen editor ↗

radians

→ radians()

Converts an angle from degrees into radians.

radians(dikirii)

radians(180) is PI. radians(90) is SEPHATLO_PI.

It is degrees turned around.

It is what you want when you have a number you know in degrees — 45, say, or 120 — and want to hand it to sin or cos, which read radians by default. It is another way of doing what seeloSaSekhutlo(DEGREES) does, but one number at a time instead of changing the whole sketch:

metlha y = sin(radians(45));

Like degrees, radians is not affected by seeloSaSekhutlo — it always takes degrees and returns radians.

The name is left as it stands. “Radian” has no Setswana word in any source searched, and it does not appear in the BGCSE mathematics syllabus at all — which is why RADIANS is untranslated too.

NameTypeDescription
dikiriipaloAn angle in degrees.
Thinking in degrees, drawing in radians
tiro setaLoeto() {
  thalaKanefase(400, 400);
  bokamorago(242);
  tlogelaMothalo();

  // Dipalo tsa dikirii ke tsona tse di bonolo go di akanya ka tsona
  metlha dikhutlo = [0, 45, 90, 135, 180, 225, 270, 315];

  gopheta (diri i = 0; i < 8; i = i + 1) {
    // radians e di fetolela mo seelong se sin le cos di se batlang
    metlha s = radians(dikhutlo[i]);

    tlatsaMmala(lekanyetsa(i, 0, 7, 60, 240), 140, 210);
    thalaSediko(200 + cos(s) * 130, 200 + sin(s) * 130, 34);
  }

  kwala(radians(180));
  kwala(PI);
}

degrees, RADIANS, DEGREES, seeloSaSekhutlo, PI