|
|
"Chris R" <car### [at] comcastnet> wrote:
>...
> I got it to work by making the following change:
>
> #declare natan2 = function(a,b) { select(a, 2*pi+atan2(a,b), atan2(a,b)) }
> #declare Theta = function {((natan2 (y, z))/pi)*tau + x*tau}
>
> The problem is that atan2 has that discontinuity where it jumps from pi/2 to
> -pi/2, ...
Hi Chris
I think that should be "from +pi to -pi".
I would also suggest that you define your new atan2() function like this;
#declare natan2 =
function(a, b) {
atan2(a, b) + select(a, 2*pi, 0)
}
;
It makes what happens a little bit clearer at the expense of an extra addition.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|