Como plotamos o vetor do ângulo de magnitude no Mathematica?

Aug 17 2020

Estou perdido em como plotar este vetor bastante simples com uma magnitude e um ângulo no Mathematica. Qualquer ajuda seria apreciada. Desde já, obrigado.

por exemplo, ângulo de 20 a 50 graus

Respostas

7 kglr Aug 18 2020 at 04:16

Você pode usar a função AnglePath:

{x, y} = {0, 0};
r = 20;
t = 50 Degree;
Graphics[{Red, Arrow @ AnglePath[{x, y}, {{r, t}}]}]

Como alternativa, você pode usar AngleVector:

Graphics[{Red, Arrow[{{x, y}, AngleVector[{r, t}]}]}]

mesma foto

6 NonDairyNeutrino Aug 18 2020 at 04:52

Com

{r, t} = {20, 50 Degree}

Você sempre pode fazer o vetor matematicamente com

vec = r {Cos@t, Sin@t}

e um exemplo ilustrativo

With[
 {pt = r {Cos@t, Sin@t}(*Mathematical implementation of the vector*)},
 Graphics[
  {
   (*Make all the lines thick*) Thickness[.007],
   (*The arrow itself*){Arrow@{{0, 0}, pt}},
   (*Arc to show label the angle*) {Circle[{0, 0}, 5, {0, 50 Degree}]},
   (*Angle label*) {Text[Style[θ == 50 Degree, 15], 4 {0.85 Cos[t/2.5], 1.1 Sin[t/2.5]}]},
   (*Magnitude label*) {Text[Style["r = 20", 15], pt {0.9, 1}]}
   }
  ]
 ]