atan
→ atan()Turns `tan` around: takes a slope and returns an angle.
atan(boleng)atan accepts any number — it has no limits like asin and acos.
By default the result lies between -SEPHATLO_PI and SEPHATLO_PI (about -1.57 to 1.57); in degrees, between -90 and 90.
Most of the time atan2 is the one you want. atan takes a single number — a slope — and one slope can come from two different directions: y / x is the same for (3, 4) and for (-3, -4). atan cannot tell them apart; atan2(y, x) can, because it sees both numbers themselves.
The name is left as it stands — see sin.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
boleng | palo | Any number — usually a slope, y / x. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(243);
boketeMothalo(3);
seeloSaSekhutlo(DEGREES);
gopheta (diri i = 0; i < 16; i = i + 1) {
metlha serepodi = lekanyetsa(i, 0, 15, -6, 6);
// atan e fetolela serepodi go nna sekhutlo
metlha sekhutlo = atan(serepodi);
mothaloMmala(lekanyetsa(sekhutlo, -90, 90, 60, 240), 140, 200);
thalaMothalo(200, 200, 200 + cos(sekhutlo) * 150, 200 + sin(sekhutlo) * 150);
}
}See also
Section titled “See also”atan2, tan, asin, acos, seeloSaSekhutlo