# How to rotate vectors in vector plot?

I'm writing an exam for my calculus students and am seeking help with using Mathematica on a particular problem.

Here's my idea: I want to give a multiple choice problem that has four choices of level curves for a surface (either $z=\sin(x)\sin(y)$ or $z=x^2-y^2$) and what's supposed to be the corresponding gradient vector field.

Here's my problem: I am able to plot two possibilities (the actual gradient vector field and the negative of that). I'd like to provide two other options, each with the vectors being tangential to the level curves (rather than orthogonal, as with the gradient vector field). Is there a way to rotate the vectors in a vector field by $90^{\circ}$? Is this a mathematical question that I should direct to math.SE?

• Can you be more specific? For example, if you plot the field with VectorPlot[{y, x}, {x, -3, 3}, {y, -3, 3}], then you can get orthogonals just by swapping the arguments VectorPlot[{y, x}, {x, -3, 3}, {y, -3, 3}] or using minus signs. Dec 1, 2014 at 19:01
• If $f(x,y)=\sin(x)\sin(y)$, the actual gradient vector field is given by VectorPlot[{Cos[x]Sin[y],Sin[x]Cos[y]},{x,-3,3},{y,-3,3}] and these vectors are orthogonal to the level curves of $f$. I'm looking to plot a vector field with vectors that are all tangential to the level curves of $f$. Dec 1, 2014 at 19:08

 grad = Grad[x^2 - y^2, {x, y}];


grad2 = Grad[Sin[x] Sin[y], {x, y}];


• Do you mind explaining what the {grad[[2]], -grad[[1]]} part of your code does? Dec 1, 2014 at 19:12
• This the reciprocal of the gradient filed. if you want to find the slop of line orthogonal to another line then the slop2 is equal to -1/slop1. in another word, {grad[[1]], grad[[2]]}.{grad[[2]], -grad[[1]]}=0 Dec 1, 2014 at 19:18
• Oh, okay. Thank you! Dec 1, 2014 at 19:25