javascript angle from two points

Solutions on MaxInterview for javascript angle from two points by the best coders in the world

showing results for - "javascript angle from two points"
Laura
27 Oct 2017
1// point 1 (x1, y1) or origine of vertex
2// point 2 (x2, y2)
3var dx = x2 - x1
4var dy = y2 - y1
5var ang = Math.atan2(dy, dx) * 180 / Math.PI;