Mathematica Mathematica: Graph for a single vector instead of vector field?

Click For Summary
To construct vectors representing the forces between two point particles on a coordinate grid, the VectorPlot function can be problematic if only raw values are used without variables, leading to errors about iteration. A more effective approach is to use arrows for visual representation. This can be achieved with the Graphics function to create arrows originating from a point, such as using Arrow to depict directional forces. Additionally, converting polar coordinates to Cartesian can help express vectors in terms of magnitude and angle, facilitating easier manipulation and visualization. An example provided demonstrates how to create an arrow based on polar coordinates using a defined function.
bentley4
Messages
66
Reaction score
0
Hi guys, I would like to construct 2 vectors on a coordinate grid.(or a vector field for only one t) of the forces between 2 point particles on a certain moment t. Can I do that?
When I try the VectorPlot function and insert all values instead of also inserting a variable it gives the error that it cannot exist out of only raw objects, that it cannot iterate.
Does anyone know how to do this?
 
Last edited:
Physics news on Phys.org
I think I tried to do this once, its very difficult to get it here you want. Basically its better to just use arrows:

Graphics[{Arrow[{{0, 0}, {0, 1}}], Arrow[{{0, 0}, {1, 0}}],
Arrow[{{0, 0}, {0, -1}}], Arrow[{{0, 0}, {-1, 0}}]}]

you could also just convert polar to cartesian to get it in terms of magnitude and angle if you needed.EDIT:
such as

AR[point_, mag_, \[Theta]_] = Arrow[{point, {mag Cos[\[Theta]], mag Sin[\[Theta]]}}]
Graphics[AR[{0, 0}, 1, 3 \[Pi]/2]]
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
24K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K