2

When I specify the rotation angle as Pi / 2 in the rotationmatrix function, then the parameter equation does rotate Pi / 2:

ParametricPlot[{x, x^2}, {x, -3, 3}]
ParametricPlot[Evaluate[RotationMatrix[-Pi/2].{x, x^2}], {x, -3, 3}]

Why do I specify the rotation angle of Pi / 2 in rotationmatrix function, but the flow field only rotates Pi / 4?

u[x_, y_, z_] := x
v[x_, y_, z_] := -y
StreamPlot[
 Evaluate[RotationTransform[-Pi/2][{u[x, y, z], v[x, y, z]}]], {x, -3,
   3}, {y, -3, 3}]
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574

1 Answers1

9

That is not a problem with Mathematica. Rather a fundamental one in your approach: you're not transforming points, but rather vectors:

You need to rotate the input, and then also the output, because you rotate the 'position' but then you also need to rotate the resulting vector:

u[{x_,y_}]:=x
v[{x_,y_}]:=-y
StreamPlot[{u[{x,y}],v[{x,y}]},{x,-3,3},{y,-3,3}]
θ=Pi/2;
rf=RotationTransform[θ];
irf=RotationTransform[-θ];
StreamPlot[Evaluate[rf@{u[irf@{x,y}],v[irf@{x,y}]}],{x,-3,3},{y,-3,3}]

Giving: enter image description here

SHuisman
  • 3,258
  • 8
  • 12