delta_x = x_cord1 - x_cord2; delta_y = y_cord1 - y_cord2; angle = -Math.atan2(delta_x, delta_y)/(Math.PI/180); trace(angle);