> Those constants aren't accurate to the limit of a float.  E.g.,
> (float)M_PI/2.0 == 1.57079637f but (float)M_PI/2.0 != 1.5707964f.

printf( "%i\n", (float) ( M_PI/2.0 ) == 1.5707964f );


> The argument to atan2 are supposed to by y,x, not x,y, assuming one
> wants the normal trigonometric convention.  But I recall the sin/cos
> tables in netrek are different, and they're what defines the truth
> about how to interpret an angle.

Units aside, sin is sin.  But the direction of "0" is chosen by the

> In a less fractured code base, there should have been some utility to
> do this so it wouldn't keep getting re-implemented.

Funny that you should mention that…  :-)