Answers for "angle from position"

0

angle from position

var deltaX = x2 - x1;
var deltaY = y2 - y1;
var rad = Math.atan2(deltaY, deltaX); // In radians
var deg = rad * (180 / Math.PI);
Posted by: Guest on October-17-2020

Browse Popular Code Answers by Language