เราจะพล็อตเวกเตอร์ขนาดมุมใน Mathematica ได้อย่างไร?

Aug 17 2020

ฉันหลงทางในการพล็อตเวกเตอร์ที่ค่อนข้างเรียบง่ายนี้ด้วยขนาดและมุมใน Mathematica ความช่วยเหลือใด ๆ จะได้รับการชื่นชม ขอบคุณล่วงหน้า.

เช่นมุม 20 @ 50 องศา

คำตอบ

7 kglr Aug 18 2020 at 04:16

คุณสามารถใช้ฟังก์ชันAnglePath:

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

หรือคุณสามารถใช้AngleVector:

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

ภาพเดียวกัน

6 NonDairyNeutrino Aug 18 2020 at 04:52

ด้วย

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

คุณสามารถสร้างเวกเตอร์ทางคณิตศาสตร์ด้วย

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

และตัวอย่างประกอบ

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}]}
   }
  ]
 ]