File:Magnet-in-homogenous-magnetic-field-rotation.svg

Summary

Description
English: Rotation of a bar magnet in a homogenous magnetic field
Date
Source Own work
Author MikeRun
SVG development
InfoField
Source code
InfoField

Python code

# paste this code at the end of VectorFieldPlot 3.0
import math

for alpha in [0,45,90]:
    alphaInRadians = alpha*(math.pi/180)
    doc = FieldplotDocument('magnet-in-homogenous-magnetic-field-'+str(alpha)+'-deg', width=400, height=400, commons=True)
    field = Field([ ['homogeneous', {'Fx':0, 'Fy':1}], ['coil', {'x':0, 'y':0, 'phi':alphaInRadians, 'R':0.25, 'Lhalf':0.75, 'I':2}] ])
    doc.draw_magnets(field)
    startx = -2
    endx = 2
    starty = 2
    endy = -2
    nlines = 12
    offset = (endx - startx) / nlines
    for i in range(nlines):
        posx = startx + (i)*offset + offset/2
        print("posx = "+str(posx))
        line = FieldLine(field, [posx, endy])
        doc.draw_line(line,  arrows_style={'min_arrows':2, 'max_arrows':2})
    doc.write()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Magnet-in-homogenous-magnetic-field-rotation.svg
Category:Self-published work Category:Bar magnets Category:Field lines around magnets Category:Magnetic force
Category:Bar magnets Category:CC-BY-SA-4.0 Category:Field lines around magnets Category:Magnetic force Category:Self-published work Category:Valid SVG created with VectorFieldPlot code