/***************************************************************************\ * This subroutine returns the cardinal angle for the Fourier phase angle. * * Unlike the position angle which repeats after 180 degrees, the cardinal * * repeats after every 360/m degrees where m is the Fourier mode. * \***************************************************************************/ #include #include #include "mymath.h" float pa (int mode, float angle) { float cardinal; cardinal = angle - ((int)(angle / (360./mode)) * 360./mode); cardinal = cardinal - NINT(cardinal/(360./mode)) * (360./mode); return (cardinal); }