|
|
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
|
|