¿Cómo trazamos el vector de ángulo de magnitud en Mathematica?

Aug 17 2020

No sé cómo trazar este vector bastante simple con una magnitud y un ángulo en Mathematica. Cualquier ayuda sería apreciada. Gracias por adelantado.

por ejemplo, 20 a 50 grados de ángulo

Respuestas

7 kglr Aug 18 2020 at 04:16

Puede utilizar la función AnglePath:

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

Alternativamente, puede utilizar AngleVector:

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

misma imagen

6 NonDairyNeutrino Aug 18 2020 at 04:52

Con

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

Siempre puedes hacer el vector matemáticamente con

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

y un ejemplo 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}]}
   }
  ]
 ]