asin
→ asin()Turns `sin` around: takes a number between -1 and 1 and returns an angle.
asin(boleng)Where sin gives you a number from an angle, asin gives you an angle from a number.
It needs a number between -1 and 1 — those are the only ones sin can return. Give it anything else and you get NaN.
By default the result lies between -SEPHATLO_PI (about -1.57) and SEPHATLO_PI (about 1.57). With seeloSaSekhutlo(DEGREES) set, between -90 and 90.
The name is left as it stands. The “a-” before “sin” is mathematical notation meaning “the angle whose sine is…”. See sin.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
boleng | palo | A number between -1 and 1. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(242);
tlogelaMothalo();
seeloSaSekhutlo(DEGREES);
gopheta (diri i = 0; i <= 20; i = i + 1) {
// Bogodimo bo tswa go -1 go ya go 1
metlha bogodimo = lekanyetsa(i, 0, 20, -1, 1);
// asin e re bolelela sekhutlo se se tlisitseng bogodimo joo
metlha sekhutlo = asin(bogodimo);
kwala(atametsa(sekhutlo));
tlatsaMmala(lekanyetsa(sekhutlo, -90, 90, 70, 240), 150, 210);
thalaSediko(40 + i * 16, 200 - bogodimo * 130, 16);
}
}See also
Section titled “See also”sin, acos, atan, atan2, seeloSaSekhutlo