# Adding a title that includes angle between two vectors in Graphic in Manipulate

Here is what I have tried thus far:

Manipulate[
Graphics[{
Black,
Arrow[{{-5, 0}, {5, 0}}],
Arrow[{{0, -5}, {0, 5}}],
Blue,
Arrow[{{0, 0}, arrowA}],
Arrow[{{0, 0}, arrowB}]
}],
{{arrowA, {3, 3}}, Locator},
{{arrowB, {-3, 3}}, Locator},
FrameLabel -> {{None, None}, {None,
Row["\[Theta] = ",
ArcCos[(arrowA.arrowB)/(Norm[arrowA] Norm[arrowB])]]}}
]


Which produces the following image.

It doesn't calculate the angle. Any suggestions?

Due to helpful suggestions: The suggestions get me to this point.

Manipulate[
Graphics[{Black, Arrow[{{-5, 0}, {5, 0}}], Arrow[{{0, -5}, {0, 5}}],
Blue, Arrow[{{0, 0}, arrowA}],
Arrow[{{0, 0}, arrowB}]}], {{arrowA, {3, 3}},
Locator}, {{arrowB, {-3, 3}}, Locator},
FrameLabel -> {{None, None}, {None,
Row["\[Theta] = ",
Dynamic[N[
ArcCos[(arrowA.arrowB)/(Norm[arrowA] Norm[arrowB])]/
Degree]]]}}]


But I just want $\theta=90$, not the Row and the Brackets.

Any further suggestions?

• Do Dynamic@ArcCos[(arrowA.arrowB)/(Norm[arrowA] Norm[arrowB])] Commented May 28, 2015 at 22:16
• Row[{"\[Theta] = ", Dynamic[ArcCos[(arrowA.arrowB)/(Norm[arrowA] Norm[arrowB])]]}]?
– kglr
Commented May 28, 2015 at 22:20
• @kguler: Almost. See your idea in my original post above. How do I get rid of the Row and the Brackets? Commented May 28, 2015 at 22:41
• As a second question, is it possible to put some code prior to the Graphics block that I could use in the Frame title without the use of Dynamic? Commented May 28, 2015 at 22:43
• Dynamic[Row[{"\[Theta] = ", N[ArcCos[(arrowA.arrowB)/(Norm[arrowA] Norm[arrowB])]/Degree]}]] Commented May 28, 2015 at 23:02

The 1-st argument given to Row must be a list.

Manipulate[
Graphics[{
Black, Arrow[{{-5, 0}, {5, 0}}], Arrow[{{0, -5}, {0, 5}}],
Blue, Arrow[{{0, 0}, arrowA}], Arrow[{{0, 0}, arrowB}]}],
{{arrowA, {3, 3}}, Locator},
{{arrowB, {-3, 3}}, Locator},
FrameLabel -> {{None, None}, {None,
Row[{"θ = ",
Dynamic[ArcCos[(arrowA.arrowB)/Norm[arrowA]/Norm[arrowB]]/
N @ Degree], "°"}]}}]


### Update

Just a suggestion, but I think the label looks better when the Row expression is written to round the angle to the nearest degree.

Row[{
"θ = ",
Dynamic[Round[ArcCos[(arrowA.arrowB)/Norm[arrowA]/Norm[arrowB]]/N @ Degree]],
"°"}]

• Perfect! Thanks to everyone who helped. Commented May 28, 2015 at 23:10
• @David, you might be interested to know that VectorAngle[] is built-in… Commented May 28, 2015 at 23:22
• @Guesswhoitis. How do you guys highlight VectorAngle[]. I've often seen this, but don't know how to do it. Think it would be good if I knew how. Commented May 28, 2015 at 23:38
• @m_goldberg: I had just tried this: Row[{"[Theta] = ", Dynamic[NumberForm[ ArcCos[(arrowA.arrowB)/Norm[arrowA]/Norm[arrowB]]/N@Degree, {3, 1}]], "[Degree]"}] Commented May 28, 2015 at 23:40
• We just enclose them in backticks (`), @David. Commented May 28, 2015 at 23:45