Re: 4 quadrant atan

2007-05-04 Thread Roel Schroeven
Charles Sanders schreef: > Roel Schroeven wrote: >> I might be wrong of course, but can't you just use atan2? Only problem >> is that it returns negative angles for quadrants 3 and 4, but that is >> easily solved. In Python: >> >> from math import atan2, pi, fmod >> def vectorAngle(x, y): >>

Re: 4 quadrant atan

2007-05-03 Thread Charles Sanders
Roel Schroeven wrote: > > I might be wrong of course, but can't you just use atan2? Only problem > is that it returns negative angles for quadrants 3 and 4, but that is > easily solved. In Python: > > from math import atan2, pi, fmod > def vectorAngle(x, y): > return fmod(atan2(y, x) + 2*pi