degrees
→ degrees()Converts an angle from radians into degrees.
degrees(diradiane)degrees(PI) is 180. degrees(PEDI_PI) is 360.
Degrees and radians are two ways of counting the same angle. One full turn is 360 degrees, or PEDI_PI radians.
Note: degrees does not touch seeloSaSekhutlo, and is not touched by it. It always converts from radians into degrees, even when the unit is set to DEGREES. Use it when you want to see a number in degrees — printing it with kwala, say — not to change how angles are read; that is what seeloSaSekhutlo is for.
The name is left as it stands, alongside the RADIANS and DEGREES constants shipped earlier. A unit name is notation used the world over, just like PI — and if DEGREES stays English, degrees has to stay with it: one concept, one vocabulary.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
diradiane | palo | An angle in radians. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(20, 25, 35);
boketeMothalo(2);
gopheta (diri i = 0; i < 8; i = i + 1) {
metlha diradiane = selekanyo(i, 0, 8) * PEDI_PI;
// Palo e le nngwe, e balwa ka mekgwa e mebedi
kwala(diradiane);
kwala(atametsa(degrees(diradiane)));
mothaloMmala(lekanyetsa(i, 0, 7, 70, 245), 165, 215);
thalaMothalo(200, 200, 200 + cos(diradiane) * 150, 200 + sin(diradiane) * 150);
}
}