Message Boards Message Boards

Plot vector functions in different coordinate systems?

Hello to all:

I teach physics at a community college in Arizona. Currently I am working on documents to assist students in visualization of Electrostatic and Magnetic fields. Almost all require either cylindrical or spherical coordinates. My question is: Given a field expressed in cylindrical coordinates, how do you generate a vector plot of the field in that coordinate system?

Please note, that I have already found a method to convert the field from cylindrical to cartesian coordinates, and the VectorPlot function works just fine once I convert it, but I would like some options so that I do not need to convert the field but rather just plot it directly. This would also be helpful in the event that I want to visualize fields in other orthogonal coordinate systems e.g. toroidal coordinates.

Thank you all for your consideration and responses.

Chris Ubing Sierra Vista, Az

3 Replies

You may use TransformedField to convert to Cartesian coordinates first, then use VectorPlot in the plane (or VectorPlot3D in 3-space) on the resulting field.

POSTED BY: Murray Eisenberg

Yes,

VectorPlot[Evaluate[
    TransformedField["Polar" -> "Cartesian", {0, 1}, {r, \[Theta]} -> {x, y}]
  ], {x, -3, 3}, {y, -3, 3}]
POSTED BY: Udo Krause

Seems not to be available directly by the usage of options to VectorPlot[]. But if e.g. there are the tangential vectors to a centered circle to be plotted

VectorPlot[{-y, x}/Norm[{x, y}], {x, -3, 3}, {y, -3, 3}]

this is in cylindrical co-ordinates {0, 1} or with other words AngleVector[ $\phi$] or with even other words

VectorPlot[AngleVector[ArcTan[-y, x]], {x, -3, 
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract