Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One thing you can do is just make sure your vector function always returns the same length, that is, to wrap it in a call to a function that unitizes it (that's a word, right?)

def unit(v):
    mag = sqrt(v[0]*v[0]+v[1]*v[1])
    return (v[0]/mag, v[1]/mag)
VF = plot_vector_field(unit([-y,-x]),[x,-2,2],[y,-2,2])

That's about what I did, anyway.