Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Jun 28, 2011 #1
    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: Jun 28, 2011
  2. jcsd
  3. Jun 28, 2011 #2


    User Avatar
    Gold Member

    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.

    such as

    AR[point_, mag_, \[Theta]_] = Arrow[{point, {mag Cos[\[Theta]], mag Sin[\[Theta]]}}]
    Graphics[AR[{0, 0}, 1, 3 \[Pi]/2]]
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook