La función atan2() calcula el ángulo entre dos posiciones. El ángulo que calcula atan2() puede ser utilizado para rotar una forma hacia algo. En este ejemplo, los ojos rotan y apuntan para mirar al cursor.
Apuntar: Revised by Darren Kessner, Malay Vasa. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.
You can find the code history of these examples here: pre-2023 example, 2023 code. You can suggest improvements by contributing to the current website!