Angle difference
#7
From what I read, it appears you're looking for something like this to determine if they're on a collision course:

Code: (Select All)
PRINT collision(0, 10)
PRINT collision(10, 0)
PRINT collision(350, 0)
PRINT collision(0, 350)
PRINT collision(0, 11)
PRINT collision(11, 0)
PRINT collision(349, 0)
PRINT collision(0, 349)


FUNCTION collision (a, b)
    t = ABS((a - b + 360) MOD 360)
    collision = t <= 10 OR t >= 350
END FUNCTION
Reply


Messages In This Thread
Angle difference - by bplus - 01-31-2023, 05:04 PM
RE: Angle difference - by MasterGy - 01-31-2023, 05:50 PM
RE: Angle difference - by OldMoses - 01-31-2023, 06:15 PM
RE: Angle difference - by bplus - 01-31-2023, 06:44 PM
RE: Angle difference - by OldMoses - 01-31-2023, 07:33 PM
RE: Angle difference - by bplus - 01-31-2023, 08:12 PM
RE: Angle difference - by OldMoses - 01-31-2023, 10:32 PM
RE: Angle difference - by SMcNeill - 01-31-2023, 09:29 PM
RE: Angle difference - by bplus - 01-31-2023, 10:03 PM



Users browsing this thread: 3 Guest(s)