POV-Ray : Newsgroups : povray.general : At wits' end : Re: At wits' end Server Time
24 May 2024 15:04:35 EDT (-0400)
  Re: At wits' end  
From: Anthony D  Baye
Date: 14 Mar 2016 17:55:00
Message: <web.56e732d2509d798cfd6b6fe10@news.povray.org>
scott <sco### [at] scottcom> wrote:
> > So if anyone can tell me what I'm doing wrong below, I'll be grateful.
>
> Two mistakes...
>
> > #macro vec2rot(V, A)
> >      #local _X_ = -V.u*cos(A)*sin(A) - V.v*cos(A)*sin(A);
> >      #local _Y_ = V.u*sin(A)*cos(A) + V.v*sin(A)*cos(A);
> >      #local RESULT = <_X_,_Y_>;
> >      RESULT
> > #end
>
> This is wrong, should be:
>
> #macro vec2rot(V, A)
>      #local _X_ = V.u*cos(A) - V.v*sin(A);
>      #local _Y_ = V.u*sin(A) + V.v*cos(A);
>      #local RESULT = <_X_,_Y_>;
>      RESULT
> #end
>
> You seem to have made it too complicated, it's just a 2D rotation:
>

Ah... >.< I see it now.  Stupid mistake.

which explains why the next part didn't work right.

Regards,
A.D.B.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.