/math-atan3

Math.atan2() for points other than (0,0).

Primary LanguageJavaScript

math-atan3

This method works like Math.atan2(), but for two points that can be other than $(0,0)$.

Technically, it returns the angle in the plane (in radians) between the line $f(x)=y_1$ and the ray from the point $(x_1,y_1)$ to the point $(x_2,y_2)$.

Math.atan3([x1, y1], [x2, y2])