* Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved.
* Copy permission is hereby granted provided that this notice is
* retained on all partial or complete copies.
* For more info on this and all of my stuff, mail edjames@berkeley.edu.
#define AUTHOR_STR "ATC - by Ed James"
#define SGN(x) ((x < 0) ? -1 : ((x > 0) ? 1 : 0))
#define ABS(x) ((x < 0) ? -(x) : (x))
#define DIR_FROM_DXDY(dx,dy) ((int) (atan2((double)(dy), (double)(dx)) \
* MAXDIR / (2 * PI) + 2.5 + MAXDIR) % MAXDIR)