10-08-2024, 06:32 PM
Quote:I try to figure out how to count angle between two points. I based my attempt on Qb64tutorials lesson 17 and there is this Trig demo I based my poor knowledge. This is simplified attempt I try to figure out:
$Color:32
screen1 = _NewImage(1280, 720, 32)
Screen screen1
Const PI = 3.1415926
x1 = 622 + 8
y1 = 395 + 8
x2 = 636 + 4
y2 = 356 + 4
angle = _Atan2(x2 - x1, y2 - y1) * 180 / PI
If angle < 0 Then angle = angle + 360
Print angle
PSet (x1, y1), White
PSet (x2, y2), White
Maybe I misunderstand something totally. The angle should be around 190, give or take, right?
^ The issue as reported on Discord, in case you can sort out what the solution might be for what they're looking for here.