Skip to content

DEGREES

A value that tells p5 to measure turning in degrees (°) — 360 in a full circle.

DEGREES is one of the two names for an angle unit; the other is RADIANS. Both names are left in English because they are unit names used the world over, just like PI. In the example below, DEGREES marks the number 90 as being in degrees, and it is converted to radians with PI / 180.

DEGREES
Convert degrees to radians
tiro setaLoeto() {
  thalaKanefase(400, 400);
  bokamorago(220);

  diri seelo = DEGREES;
  diri tekanyo = 90;
  diri boleng = tekanyo;

  // Fa re bala ka dikirii, re fetolela go diradiane
  fa (seelo === DEGREES) {
    boleng = tekanyo * PI / 180;
  }

  // Jaanong boleng ke SEPHATLO_PI
  tlatsaMmala(70, 130, 180);
  kgolokwe(bophara / 2, boleele / 2, boleng * 100);
}

RADIANS, PI, SEPHATLO_PI