Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger
| Name |
atan2() |
| Examples |
Programmteil wo_immerwider_gmacht_wird() bitte
Hintergrund(204);
verschieb(Feischterbreiti/2, Feischterhoechi/2);
Komazahl a = atan2(MuusY-Feischterhoechi/2, MuusX-Feischterbreiti/2);
draei(a);
Viereck(-12, -5, 24, 10);
danke |
| Description |
Calculates the angle (in radians) from a specified point to the coordinate origin as measured from the positive x-axis. Values are returned as a Komazahl in the range from PI to -PI. The atan2() function is most often used for orienting geomeVersuech to the position of the cursor. Note: The y-coordinate of the point is the first parameter and the x-coordinate is the second due the the structure of calculating the tangent. |
| Syntax |
atan2(y, x); |
| Parameters |
| y |
Ganzizahl or Komazahl : y-coordinate of the point |
| x |
Ganzizahl or Komazahl : x-coordinate of the point |
|
| Usage |
Web & Application |
| Related |
tan()
|
Stefan Baltensperger 2009