Le jeudi 31 janvier 2019 06:52:10 UTC+1, Tevian Dray a écrit : > > >> You can use the plot functionality of vector fields on > >> Euclidean spaces to get better arrowheads: > > OK; I can get jmol to work with some browsers, although it is painfully > slow. But the results are very nice. > > Hopefully, some day threejs will replace jmol as the default 3d viewer: https://trac.sagemath.org/ticket/22408
> Finally, is there a simple mechanism to enable Sage to plot vector fields > with singularities, such as a pole at the origin? I've had no luck yet > trying to plot something like: > E.vector_field((-y/(x^2+y^2),x/(x^2+y^2))) > I've tried piecing together nonsingular domains, although I'm possibly not > doing it correctly. But there is surely a more elegant solution, such as > cutting off the vector field at some maximum magnitude. > The cut off should definitely be added to the plot method of vector fields, among many other improvements to be done... Meanwhile, you can define a subdomain of E, U say, where the vector field is everywhere regular and plot the restriction of the vector field to U. For your example, U can be E minus the disk x^2+y^2 <= 0.01: sage: E.<x,y> = EuclideanSpace() sage: v = E.vector_field((-y/(x^2+y^2),x/(x^2+y^2))) sage: U = E.open_subset('U', coord_def={E.cartesian_coordinates(): x^2+y^2>0.01}) sage: v.restrict(U).plot(max_range=1, scale=0.2) In the above code, "coord_def" stands for the coordinate definition of the open subset U and "v.restrict(U)" is the restriction of v to U. Best wishes, Eric. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.