I have a question: Given a vector $v=(1,0)$ and a matrix $A(φ)= \begin{pmatrix} cos(φ)&-sin(φ)\\ sin(φ)&\phantom{-}cos(φ)\\ \end{pmatrix}$

I have to write a manipulate command for the value of the inner product $⟨v,A(φ)v⟩$, where $φ$ is in the interval $[0,2π]$. Than I have to plot a graph of $⟨v,A(φ)v⟩$. How can I make this? I have already tried using the Manipulate[] command, but how can I plot this? I have tried Plot[{v,v.A(φ).v},{φ,0,2Pi}] but it plots only the vector $v$. Thank you.

  • 2
    $\begingroup$ Welcome to Mathematica.SE! Note that this is not a service where we will write all the code you need! Please give an idea of where you're stuck in this problem. If you are a Mathematica beginner and don't know how to make matrices and vectors, then this will be helpful. Inner products are done by using Dot. Finally, for plotting, check out this tutorial page. $\endgroup$
    – march
    Commented Apr 10, 2019 at 18:11
  • $\begingroup$ You may define A by A = t \[Function] {{Cos[t],-Sin[t]},{Sin[t],Cos[t]}}. $\endgroup$ Commented Apr 10, 2019 at 18:17

1 Answer 1


Using Henrik's function definition:

A = ϕ \[Function] {{Cos[ϕ], -Sin[ϕ]}, {Sin[ϕ], Cos[ϕ]}};

v = {1,0};

 Show[Plot[v.A[ϕ].v, {ϕ, 0, 2 π}], 
  ListPlot[{{ϕ, v.A[ϕ].v}}, 
   PlotStyle -> {Red, PointSize -> Large}]], {ϕ, 0, 2 π}]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.