Too dumb to do the maths

BlitzMax Forums/BlitzMax Beginners Area/Too dumb to do the maths

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

No - I can't really just do that. For example if the angle between two objects is 170 and the angle that object one is travelling along is 20 then simply subtracting one from the other gives 150. But in this example I would want to return 30.

I guess from this I could maybe get the absolute difference between the two angles and then look at which 90 degree quadrant the resultant angle is in and depending on which one it falls in do the following:

RESULTANT ANGLE ACTION
< 90 : do nothing
> 90 and <= 180 : 180 - result
> 180 and <= 270 : result - 180
> 270 and <= 360 : 360 - result

I think this will always give me how close the object paths are to being at right angles to each other. Does this look right to anyone else (or even make sense to anyone)?