|
|
"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, which happens along the edge you are looking at, and is made visible by
> the switch in sign of the x value (x*tau). The natan2 puts that discontinuity
> at opposite ends of the value range, rather than in the middle and makes all of
> the resulting angles positive (0-2*pi), and thus there is no abrupt switch when
> x goes negative.
>
> -- Chris R
Most Excellent, fine Sir!
Some days I can see what needs to be done - other days it's more . . . opaque.
I'm officially voting that such be made an internal function, or at least
something available in functions.inc
This could save a lot of people a lot of trouble in the future.
Thank you,
- BW
Post a reply to this message
|
|