Relative angle between 2 vectors

Blitz3D Forums/Blitz3D Programming/Relative angle between 2 vectors

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.

This is the best I've come up with, so far:
ang# = ATan2(y2,x2) - ATan2(y1,x1)
If Abs(ang) > 180 Then ang = ang - (360.0 * Sgn(ang))