plotting tangent vectors to a curve

48 views
Skip to first unread message

Fernando Q. Gouvea

unread,
Apr 8, 2022, 4:13:51 PM4/8/22
to sage-s...@googlegroups.com
There is an easy way to plot vector fields in Sage. Is there an easy way
to plot a curve and (some of) its tangent vectors? I don't think
plot_vector_field would play along if I wanted to restrict to a curve.

Fernando

--
==================================================================
Fernando Q. Gouvea
Carter Professor of Mathematics
Colby College
Mayflower Hill 5836
Waterville, ME 04901
fqgo...@colby.edu http://www.colby.edu/~fqgouvea

No matter where you stand, no matter how far or fast you flee, when it
hits the fan, as much as possible will be propelled in your direction,
and almost none will be returned to the source.
-- John L. Shelton

Eric Gourgoulhon

unread,
Apr 13, 2022, 9:12:43 AM4/13/22
to sage-support
Hi,

Le vendredi 8 avril 2022 à 22:13:51 UTC+2, fqgo...@colby.edu a écrit :
There is an easy way to plot vector fields in Sage. Is there an easy way
to plot a curve and (some of) its tangent vectors?

You can achieve this via the method tangent_vector_field() of curves,
see the second plot ("Plot of the curve and its tangent vector field") at

Eric.
 

kcrisman

unread,
Apr 13, 2022, 1:18:48 PM4/13/22
to sage-support
Eric, if I opened a ticket, would you be willing to add a couple examples of this to the plot documentation?  I wasn't aware of this but it would be a great addition.  (Is there a 3d version as well for space curves?)

Eric Gourgoulhon

unread,
Apr 14, 2022, 9:54:16 AM4/14/22
to sage-support
Le mercredi 13 avril 2022 à 19:18:48 UTC+2, kcrisman a écrit :
Eric, if I opened a ticket, would you be willing to add a couple examples of this to the plot documentation?  

Yes of course. 

I wasn't aware of this
 
but it would be a great addition.  (Is there a 3d version as well for space curves?)

Yes it works for curves in 3d space, an more generally in any dimension (but the plots are then projections to 2d or 3d spaces).
An example of a 3d curve plotted with its tangent velocity field is the loxodrome of the sphere shown at

Eric.

kcrisman

unread,
Apr 14, 2022, 2:12:54 PM4/14/22
to sage-support
Great stuff!  See https://trac.sagemath.org/ticket/33711 for this. 
Reply all
Reply to author
Forward
0 new messages