# Infinite expression 1/0 between v8 and v12.3 [closed]

when i try the answere of Mr.Wizard from How can I reproduce a beautiful 3D vector plot?

ϕ[x_, y_, z_] := (Pi Exp[-Dot[{x, y}, {x, y}]/2] - Pi/2);
V[x_, y_, z_] := Evaluate[Simplify[ComplexExpand[-RotationMatrix[ϕ[x, y, z], {y, -x, 0}].{x, y, 0}/Sqrt[{x, y}.{x, y}]]]];
V[0, 0, z_] := {0, 0, -1};
R = Pi;
P = Select[Flatten[Table[Table[{x, y, 0}, {y, -R, R, R/20}],{x, -R, R, R/20}], 1], X \[Function] -R <= X[[1]] - X[[2]] <= R];
P = Transpose[{{1, -1/2, 0}, {0, Sqrt[3]/2, 0}, {0, 0, 1}}.Transpose[P]];
colfun[x_, y_, z_] := Evaluate[Simplify[ColorData["TemperatureMap"][(Pi/2 - ϕ[x, y, z])/Pi]]];
arrow[p1_, p2_] := {EdgeForm[], FaceForm[colfun @@ p1], Cone[{p1, p2}, 1/24]};
Show[
Graphics3D[{arrow @@@ Transpose[{P, P + 1/4 V @@@ P}]}],
PlotRange -> All,
Lighting -> "Neutral",
Boxed -> False
]


i get

 Power: Infinite expression 1/0^2 encountered.


as error message and there is one line missing:

Can you tell me, what i am doing wrong? It seems that he just used exactly that lines to produce the figure shown there. I am using Mathematica 12.3 while theirs seems to be v8. Did something changed or am i just missing a definition?

• Welcome to the Mathematica Stack Exchange. Go to the Evaluation menu and choose Quit Kernel -> Local and then try this code again. Thanks.
• Add // Simplify[#, Assumptions -> Element[{x, y, z}, Reals]] & at the end of definition of V[x_,y_,z_] to get rid of Abs and so on, and it works fine ! Aug 24, 2022 at 17:46
• By the way, you notice this, if you check step by step and use Set instead of SetDelayed in defintion of functions like V to see at once how they look like. Since you define V with Evaluate SetDelayed makes no sence. Aug 24, 2022 at 17:53