Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help needed regarding Lesson 17
#7
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:
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 + ...
Reply


Messages In This Thread
Help needed regarding Lesson 17 - by RhoSigma - 10-08-2024, 10:39 AM
RE: Help needed regarding Lesson 17 - by bplus - 10-08-2024, 05:24 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-08-2024, 05:46 PM
RE: Help needed regarding Lesson 17 - by SMcNeill - 10-08-2024, 06:32 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-08-2024, 06:59 PM
RE: Help needed regarding Lesson 17 - by SMcNeill - 10-08-2024, 07:04 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-08-2024, 07:17 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-08-2024, 07:10 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-08-2024, 07:22 PM
RE: Help needed regarding Lesson 17 - by SMcNeill - 10-08-2024, 07:44 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-08-2024, 08:16 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-09-2024, 01:25 PM
RE: Help needed regarding Lesson 17 - by SMcNeill - 10-09-2024, 04:19 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-09-2024, 03:17 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-09-2024, 04:00 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-09-2024, 04:11 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-09-2024, 10:43 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-10-2024, 10:33 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-11-2024, 03:01 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-11-2024, 06:36 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-11-2024, 07:08 PM
RE: Help needed regarding Lesson 17 - by bplus - 10-11-2024, 08:51 PM



Users browsing this thread: 2 Guest(s)