blob: c487e3d1c901b7d8fcf3deba324fe7231959d8d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#include "util.h"
#include <math.h>
R arg(R re,R im)
{
if(re)
return fmod(atan(im/re)+(re < 0?2*PI:PI),2*PI)-PI;
else
if(im || re) return im > 0?PI/2:-PI/2;
else return 0;
}
|