Oh thanks Steve, he almost got it right but y's over x's or Y's come first for _Atan2 then x's in 2nd argument:
fixed: his line is just over 270 degrees or 283 something:
And the angle from point 2 (x2, y2) to point 1 (x1, y1) would be 283 - 180 = 103 degrees just past 90 clockwise.
fixed: his line is just over 270 degrees or 283 something:
Code: (Select All)
screen1 = _NewImage(1280, 720, 32)
Screen screen1
Const PI = 3.1415926
x1 = 622 + 8
y1 = 395 + 8
Circle (x1, y1), 1, &HFFFFFF00 ' yellow
x2 = 636 + 4
y2 = 356 + 4
Circle (x2, y2), 1, &HFFFFFFFF ' white
Line (x1, y1)-(x2, y2), &HFF0000FF ' blue
'angle = _Atan2(x2 - x1, y2 - y1) * 180 / PI
angle = _Atan2(y2 - y1, x2 - x1) * 180 / PI ' y's first, x's 2nd for Atan2
If angle < 0 Then angle = angle + 360
Print angle
And the angle from point 2 (x2, y2) to point 1 (x1, y1) would be 283 - 180 = 103 degrees just past 90 clockwise.
b = b + ...